Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Power ups - Design theory?

Author
Message
BowserYo
16
Years of Service
User Offline
Joined: 4th Jan 2008
Location:
Posted: 29th Jul 2009 21:36
Hello,

I am making a "3d Side scroller shooter" game, basically the player moves from left to right (Like the old mario games).

I've got a small level and collisions (using Sparky's DLL), a working jet pack that runs out of fuel and recharges, health (basically just a number right now) and a gun with ammo (basically, everything works on that except the hard part: actually shooting bullets). I haven't done much for graphics yet, I figure that's best to be done last.

So next thing I want to work on is powerups... I've never seen how someone else has done them and I'm new to programming so I was wondering how I should go about doing them... Should I use a function to create them? If I could somehow make a function like this:



Then have the function actually do the collision detection and handle any animations I would want to put on it... I'd rather not have to code the entire powerup every time I place one on the map.

Any ideas? Thanks!

ßõw§€r¥¤

Attachments

Login to view attachments
zeroSlave
15
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 30th Jul 2009 18:25 Edited at: 30th Jul 2009 18:26
First, I would make a TYPE that would handle the X, Y, Z, Type of Powerup, Id, Animation_Frame, (and whatever else would be needed)

And, I would have a few functions made:
One for spawning it
that would give it an ID and make/show the object that will be used;

One for handling the animation and physics that would be called every loop


One for picking it up when a collision from the player occurs


I would make a function for each type of power up that could be called when it is picked up by the player


And one for deleting/hiding it that could be called when it is picked up or drops off the bottom of the screen like mario


I know this isn't the full code or anything, but it is the structure that I usually use when making powerups and such. Hope it helps!

There's something in this room that makes you can't speak well.
BowserYo
16
Years of Service
User Offline
Joined: 4th Jan 2008
Location:
Posted: 30th Jul 2009 18:29
Perfect! Thats exactly what I was looking for!

I'm still a newbie when it comes to functions so I'll be going through some tutorials before I start on this then.

Thanks again!

ßõw§€r¥¤
zeroSlave
15
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 30th Jul 2009 21:34
Hey, no prob! Functions are handy as can be, and are much easier than they seem. Have fun!

There's something in this room that makes you can't speak well.
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 1st Aug 2009 03:16
Quote: "FUNTION Obtain_Powerup(TypeofPowerup, PowerupID)"


Actually that could just have the PowerupID since the type of power up is already stored in the Powerup array .

<-- Spell based team dueling game!

Login to post a reply

Server time is: 2024-11-24 04:24:18
Your offset time is: 2024-11-24 04:24:18