#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# Powe Ups

Posts: 0Member

Okay this is the scenario:
When player collides with the power up, i want my player to fire that power up random. For example player collides with power up, it shoots fire for 5 seconds. Every time i make it the player doesn't shoots the power up.

• Posts: 8,188Member
edited July 2014

This is all about attributes (variables).

You want to change what the player is doing when he picks something up.

So you'd have a boolean variable (call it, say, '5secondshot').

When the player collides with the pickup, change '5secondshot' to true.

On the player, have a rule that says:
If variable 5secondshot is true
For five seconds - SHOOT
After 5 seconds, change variable 5secondshot to false

That should do it. Manipulating variables is the very core of making a game, and is bloody handy and fun!

QS =D

EDIT:
If you want a random power up, you'd have a variable called 'RandomPowerup'
When the player picks up the power up you'd change the variable 'RandomPowerup' to random(1,5) (for example).

Then the player would have rules on him that say:
If 5seconshot is true
and RandomPowerup is 1
Shoot round bullets for five seconds

If 5seconshot is true
and RandomPowerup is 2
Shoot square bullets for five seconds

and so on.

Dr. Sam Beckett never returned home...