Turret Attributes?

Hey everyone, I need some advanced help.
I'm making a missile defense game (here's a screenshot)
http://i51.tinypic.com/10rpz12.jpg
The missiles will come in from the top of the screen, and the player's job, of course, is to protect the city from destruction. What I need help with is how the player will shoot down impending doom. I want a bullet to originate from the bottom of the screen and head for where the player taps. Any help? Thanks!
I'm making a missile defense game (here's a screenshot)
http://i51.tinypic.com/10rpz12.jpg
The missiles will come in from the top of the screen, and the player's job, of course, is to protect the city from destruction. What I need help with is how the player will shoot down impending doom. I want a bullet to originate from the bottom of the screen and head for where the player taps. Any help? Thanks!
Comments
Have you looked at all the videos in the CookBook and on youtube. All your answers are there.
But here goes nothing
Firstly: Make a Turret actor. Place it where you want it to shoot from.
Then open the actor and create a new rule:
If touch is pressed
Constrain Attribute: vectorToAngle(game.Mouse.Position.X-self.Position.X , game.Mouse.Position.Y-self.Position.Y)
Spawn Attribute
Actor: (your bullet) in back of layer
Open up you bullet actor:
Put in a move behavior
Direction 0 relative to actor
Speed = (what ever you want)
Killing your enemy:
Create a new rule on your bullet:
If actor overlaps or collides with enemy
Destroy
Create new rule on enemy:
If actor overlaps or collides with bullet
destroy
Create a new integer game attribute called score
Make an Actor called score
Set opacity to 0 and put a text behavior and give it a bright color.
where it says hallo world, theres a small e where you select your game.score attribute.
put the actor in your scene.
Go back to your enemy:
In the other rule you made, put in a change attribute behavior
Change attribute game.score to game.score+(how many points you want for killing and enemy)
There... i made the game for
If you have 3 images of each building. you can make it the buildings crumble each time it gets hit but your enemy missiles.
Thanks.
You use the expression editor to get it all in the same expression. But it seems to me like your getting ahead of yourself. You should check out all the videos on the gamesalad cookbook youtube channel and on gshelper.com
http://i51.tinypic.com/s6hb1z.jpg
So what should be in the first box (Constrain Attribute:)?
Sorry for the noobish Questions. Thanks for all your help!