Shooting - Touch
Hello!
I'd like to know how I could make my character shoot a bullet in the direction I click (or touch) and create a crack(for instance) on the (let's say a wall).
Example : If I touch somewhere on a wall to shoot, the bullet will go whereever I touched and create a crack actor where the bullet went.
My character can move from left to right and jump.
Thanks a lot!
I'd like to know how I could make my character shoot a bullet in the direction I click (or touch) and create a crack(for instance) on the (let's say a wall).
Example : If I touch somewhere on a wall to shoot, the bullet will go whereever I touched and create a crack actor where the bullet went.
My character can move from left to right and jump.
Thanks a lot!
Comments
http://gamesalad.com/game/play/83629
You'll just need to also spawn a crack actor (LOL!) at the X/Y co-ordinates where the player touches (this demo points in the direction but the bullet continues on but should give you everything you need to figure it out).
Good luck.
But now I'm wondering how to make the gun follow the Main character actor.
I have tried to do it with the "follow actor" wiki, but I can't make it work.
Thank you!
1. create two game level attributes called playerx and playery
2. in the main character actor, constrain game.playerx to self.position.x and do the same for player Y, only use Y instead of X.
3. In the gun actor, constrain self.position.X to game.playerX and do the same for Y, using the Y value.
That's what I was looking for.
Also, I used firemaplegames's Platformer tutorial to make my character move.
Everything's fine except the player don't stop moving. When I press "RIGHT", he goes right but if the RIGHT key is up, he still going right.
Any ideas of what I did wrong?
Thank you!
i have a shoot button and an actor with gun image..
what i want is to press the shoot button and let the gun shoot.. how can i make this ?
thnx
In the button-
Rule; If touch is pressed-
change attribute "fire" to "true"
Otherwise
change attribute "fire" to "false"
Im not sure how you have the gun fire but if you have it spawn the bullet actor use
In the gun-
rule; if attribute "fire" is "true"
Spawn actor "bullet"
i tried what you said but did not help..
Look:
I want to pres the Shoot button, and then the gun would animate and shoot..
how can i make the shoot button tells the gun to shoot..?
thnx