Powe Ups
geekninja
Member Posts: 0
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.
Comments
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...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
There is a power up tutorial below. It's not the exact effect you want but probably will help you get there.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page