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

The Partridge Family were neither partridges nor a family. Discuss.
cameron
Posts: 794
Joined: June 26th, 2012, 5:38 pm
Location: USA

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

Post by cameron » July 17th, 2012, 5:37 pm

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.
Attachments
Chili DirectX Framework - shipgame - Copy.rar
(664.57 KiB) Downloaded 345 times
Last edited by cameron on July 23rd, 2012, 2:37 am, edited 8 times in total.
Computer too slow? Consider running a VM on your toaster.

User avatar
XxWalKaxX
Posts: 244
Joined: June 11th, 2012, 7:15 pm

Re: Help with my first game after lesson 14.

Post by XxWalKaxX » July 17th, 2012, 5:56 pm

it didnt crash for me
What you call a bug...I call a new feature!

cameron
Posts: 794
Joined: June 26th, 2012, 5:38 pm
Location: USA

Re: Help with my first game after lesson 14.

Post by cameron » July 17th, 2012, 6:36 pm

it happens under some circumstances that I dont know of it always crashes for me once i get into it.
Computer too slow? Consider running a VM on your toaster.

cameron
Posts: 794
Joined: June 26th, 2012, 5:38 pm
Location: USA

Re: Help with my first game after lesson 14.

Post by cameron » July 17th, 2012, 6:38 pm

I think i may have made some mistakes in my code.
Computer too slow? Consider running a VM on your toaster.

User avatar
magusofmirrors
Posts: 56
Joined: May 12th, 2012, 10:03 pm

Re: Help with my first game after lesson 14.

Post by magusofmirrors » July 17th, 2012, 11:39 pm

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.
The admins are coming!!!

Image

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: PLEASE HELP with my first game I made.

Post by chili » July 18th, 2012, 3:41 am

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.
Chili

User avatar
codinitup
Posts: 112
Joined: June 27th, 2012, 7:43 am

Re: PLEASE HELP with my first game I made.

Post by codinitup » July 19th, 2012, 5:50 am

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.
MOOOOOO

cameron
Posts: 794
Joined: June 26th, 2012, 5:38 pm
Location: USA

Thanks for the help.

Post by cameron » July 19th, 2012, 4:07 pm

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.
Computer too slow? Consider running a VM on your toaster.

User avatar
codinitup
Posts: 112
Joined: June 27th, 2012, 7:43 am

Re: PLEASE HELP with speed boost collison.

Post by codinitup » July 19th, 2012, 8:04 pm

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 :)
MOOOOOO

cameron
Posts: 794
Joined: June 26th, 2012, 5:38 pm
Location: USA

Re: PLEASE HELP with speed boost collison.

Post by cameron » July 19th, 2012, 8:23 pm

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.
Computer too slow? Consider running a VM on your toaster.

Post Reply