I can't work out how to track when enemies leave the camera view.

Hi guys, I'm back with another newbie question. I think I have a decent enough understand of GameSalad's mechanics, but I can't figure out how to do something.

I want enemies in my game to enter the camera view, attempt to perform an action (moving in a certain way and shooting at the player), and then attempt to leave the camera view, at which point they will either be destroyed or recycled (I'm still not sure why actors get recycled rather than destroyed, but that's a digression for now :) ).

The player's job is to 1) stay alive and 2) kill enemies before they "escape." I want to set it so that if player goes for a set period of time (like 5 second, for example) without any "escapes," a scoring bonus kicks in. Another way to implement the same thing would be to go for a set number of enemies (like 15 enemies, for example). Either one would be fine.

What is hard for me is coming up with a way to track escapes, relative to either time or enemies entering into the camera view.

I hope I've explained that well enough... would anyone have any idea of how this can be accomplished?

Thanks in advance for the help :)

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Hold on, let me make you a quick demo
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    edited February 2013
    Is this kind of what your looking for? Let me know if this isn't what you looking for and I'll see if I can revise it for you.
  • wirelesstkdwirelesstkd Member Posts: 75
    Hey Braydon, I'm working through it now. I have a really stupid question, though... what does the percent sign do in the equation?
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    It's pretty much saying when the score is 5, it's switching it back to 0. :P Take a look at this video for a more in-depth look. http://gshelper.com/?p=1985
  • wirelesstkdwirelesstkd Member Posts: 75
    Thanks, Braydon... I had also planned on doing something with Waves in this game... I set out to make something easy for my first game... not even anything I'd ever release, but just to make something so I could figure this system out. I think my "easy" game wasn't so easy, afterall, lol... still, I have to learn this stuff.

    I see that you used the percent sign in that video, too, but I'm still not sure what it does. I tried googling % in algebra, but it wasn't much help. Is this an algebra thing, or a programming thing? I'm pretty weak with both, lol.
  • wirelesstkdwirelesstkd Member Posts: 75
    Okay, I googled it relative to programming and got it. It acts like a division sign, but it returns only the remainder. I'm just not sure what it's doing here, lol...

    Actually, it seems like it prevents the system from doing what it's supposed to do. Removing it causes the how many seconds attribute to increase by one every second and only reset when an enemy escapes. So I think that's what I was trying to do.

    Is something going to break later if I incorporate this in to my game without using the percent sign?
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Ah, gotcha, you only wanted it to go back when an actor escaped. That would've been easier lol. Nah, I think your good, man. You should be good to go!
  • wirelesstkdwirelesstkd Member Posts: 75
    lol, thanks Braydon! I really appreciate the help. It's frustrating trying to figure this stuff out, but this forum is uncharacteristically helpful. Are we sure this is actually the internet?
Sign In or Register to comment.