How do I make one actor spawn another actor only once?
CoolBee
Member Posts: 81
I'm wanting to make a gun that shoots my flying actor into the air based on a power bar then have the camera follow the bird with his controls now in use can anyone help me with this?
I've made things like the canon and other templates but either I end up with more actors than I can shake a stick at or the camera gets stuck on the canon.
Do I need a rule like if canon is pressed then interpolate bird to position Y+50 otherwise (insert full bird rules)? Then maybe move canon to position (x,y) till bird touches ground then destroy actor and move the canon back to restart for a new life etc?
I've made things like the canon and other templates but either I end up with more actors than I can shake a stick at or the camera gets stuck on the canon.
Do I need a rule like if canon is pressed then interpolate bird to position Y+50 otherwise (insert full bird rules)? Then maybe move canon to position (x,y) till bird touches ground then destroy actor and move the canon back to restart for a new life etc?
Comments
make an game integer called camera
BIRD ACTOR
Create a new rule
If "birds" self.motion.linear.X is > then 0
Change attribute game.camera to 1
otherwise
Change attribute game.camera to 0
Create new rule
If game.camera is = 1
Control camera
CANNON ACTOR
Create new rule
If game.camera is = 0
Control camera
here is a video on how to make a cannon powermeter
You replied quicker than my phone would upload a reply thanks man ill give it a go
- Make a boolean attribute called shotInPlay and set it false
- In your shooting rules only allow shooting if shotInPlay is false
- When you shoot, change shotInPlay to true
-When your projectile touches the ground & destroys, set shotInPlay back to false
Then you will only be able to shoot one shot at a time.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page