Shooting an Enemy (help)

DillonVDillonV South FloridaMember Posts: 26
Hello everyone, i'm having a little trouble with something and I was wondering if someone can help me out. I'm new to game salad so I apologize in advance if I don't word this correctly. In my current scene, there are 3 actors at the bottom of the screen that remain still, and each are different colors. These three actors are the main player controllers. In the game, different colored enemies spawn in the scene (for example, the green actor has to shoot the green enemy, blue actor shoots blue enemy, ect.). This is where i'm having trouble though...I want players to have to click on the right color actor at the bottom first, then click on the right color enemy on the screen. When the enemy is clicked, the bullet spawns from the bottom actor and shoots the enemy. I hope this makes sense lol...
Thanks in advance.

Comments

  • JScottJScott Member Posts: 143
    Hey there, I'm new too, so I can't tell you the exact steps off the top of my head, but that's certainly do-able.
    I'd start with a When touched is pressed on your shooting actor-spawn actor (your bullet).

    For the bullet, set up a rule move to (or accelerate) towards the next touch coordinates. You could move (or accelerate) to the coordinates, or simply in that direction (I think). I think start with another When Touch is pressed rule -- move to...

    A few different choices, including move,move to, rotate, accelerate-you'd have to play around to find which works best for you.

    Hopefully get you started, someone else can probably tell you exactly what to do.
  • DillonVDillonV South FloridaMember Posts: 26
    Thank you! Ill try it out and see how it goes.
  • DillonVDillonV South FloridaMember Posts: 26
    Well I tried it out...It didn't work out so well for me :/ I still appreciate the help though! I'll look harder into it.
  • sincitygamessincitygames Member, PRO Posts: 6
    I would think that if you thad an attribute for "blue_can_fire" and default make it false, then when a blue enemy pops on screen change it to true. Then put a rule on the blue actor that if blue_can_fire = true, then allow the action to take place. When enemy destroyed turn blue_can_fire to false. Also put in a rule that when blue enemy moves (this will help if you have multiple enemies of the same color on screen) check to see if blue_can_fire is true, if it isn't make it true.
  • allc1865allc1865 Member, PRO Posts: 777
    I'll make you a template. Give me a minute.
  • allc1865allc1865 Member, PRO Posts: 777
    Here we go. They're not spawned or anything, but when you hit the enemy and them touch player, the bullet will spawn, which is what you wanted, right? I'll try and work on them spawning if you still need it. Let me know.
    Hope this helps.
    https://www.dropbox.com/s/hodq4mwbffk8uuj/colorshoot.zip
  • DillonVDillonV South FloridaMember Posts: 26
    Here we go. They're not spawned or anything, but when you hit the enemy and them touch player, the bullet will spawn, which is what you wanted, right? I'll try and work on them spawning if you still need it. Let me know.
    Hope this helps.
    https://www.dropbox.com/s/hodq4mwbffk8uuj/colorshoot.zip
    Thank you for the template! That's definitely part of what I need. And sincitygames, thank you for the help as well. That's the part I was stuck on. The player has to touch one of the three actors at the bottom to "activate" them. When the actor is activated, the actor glows for about 2 seconds, then shuts off. When the actor is glowing, that's when the player has to shoot the right colored enemy to get points. The player can only shoot a bullet when one of the actors is activated. Anyway, Ill try out these commands and see how they work out. Thanks!
Sign In or Register to comment.