Page 1 of 2

Would like help with powerups in my game after lesson 14.

Posted: July 17th, 2012, 5:37 pm
by cameron
Hello Chili and everyone. Ive made this game after lesson 14. This a ship game I've recently made. I fixed the game from crashing. I get the The speed boost and the backwards boost to work.But I would still like to get the 3 bullet shoot powerup and the orb defender powerup to work before i post my game on the forum. Object of game don't let ships get to bottom of screen and to don't get hit by the ships bullets. Controls: up, down, left, right, and space to shoot and enter for menu select.

Re: Help with my first game after lesson 14.

Posted: July 17th, 2012, 5:56 pm
by XxWalKaxX
it didnt crash for me

Re: Help with my first game after lesson 14.

Posted: July 17th, 2012, 6:36 pm
by cameron
it happens under some circumstances that I dont know of it always crashes for me once i get into it.

Re: Help with my first game after lesson 14.

Posted: July 17th, 2012, 6:38 pm
by cameron
I think i may have made some mistakes in my code.

Re: Help with my first game after lesson 14.

Posted: July 17th, 2012, 11:39 pm
by magusofmirrors
cameron wrote:I think i may have made some mistakes in my code.
You think? ...

Yeah, just use debugging skills that chili teaches and you should be able to hunt it down.

Re: PLEASE HELP with my first game I made.

Posted: July 18th, 2012, 3:41 am
by chili
The first step of debugging is identifying the conditions for reproduction of the bug. Without this information it is very difficult to debug a program.

Re: PLEASE HELP with my first game I made.

Posted: July 19th, 2012, 5:50 am
by codinitup
Just a quick tip, I noticed that you had some logic in the compose frame function. You should always put logic in a function, sometimes a little is ok in the compose frame, but you had a lot.

Thanks for the help.

Posted: July 19th, 2012, 4:07 pm
by cameron
Any tips/comments were helpful i have fixed most of the errors. Maybe ill post my finished game on the forum .But im still trying to figure out how to get the speed boost to work out.

Re: PLEASE HELP with speed boost collison.

Posted: July 19th, 2012, 8:04 pm
by codinitup
A speed boost is easy to do. You need to add another variable (you should probobly use a float) and you need to add it to your drawing function. Set the value of the variable to 0. Then add a conditional statement, for example:

Code: Select all

if (kbd.EnterIsPressed && kbd.RightIsPressed())
{
    xSpeed = 3;
}
You need to test for the kbd.RightIsPressed() because the speed is positive. You also should have a ySpeed variable so that you can tests for the case that up or down is pressed. You also need to change the value's according to the direction that they are going. I hope this helped :)

Re: PLEASE HELP with speed boost collison.

Posted: July 19th, 2012, 8:23 pm
by cameron
No i want it to be like a powerup that falls from the top of the screen and if your ship and the power up overlap it increases your speed for a certain amount of time. I cant get the collision of the powerup and your ship to work. Sorry for the confusion.