How do you make power ups?

omgitskara

  • Posts: 17
I was thinking of making a top down shooter game and I was browsing forge to see if it had all of the code pieces I needed. I searched for power ups but nothing came up. I'm looking to make randomly spawned power up coins that give the player special abilities such as : Increased damage with gun, Run faster, Bomb, special weapon, shield ,ext. Also I would like these power ups to last a specified time. Is there anything on forge that could do these things? If not would anyone be so kind as to tell me how to create these things. =]

mkross1983

  • Posts: 22
I played around with making a power up in the demo Jump and Run game.  Modified the health pack item.

First thing you'll need to do is have behaviors that specify how much health an enemy has and how much damage your character does to it by default.  You'll want those to be variables.

When you collect a damage power for example, you'll want to increase the damage variable by however much you want the power up to be.

I made it so when you hit the health pack you scaled up to 1.5 times normal size and your dmg doubled.  Just put the code in a "Do For x Seconds" loop and when the loop exits return your dmg and other variables to the normal amount.

I found it easier for testing to draw the variables on the screen somewhere so you could see if they are increasing correctly or not.

omgitskara

  • Posts: 17
Cool ,thank you for posting. =D