My 1st Turret Project

DaneVincentDaneVincent Member Posts: 7
edited July 2012 in Working with GS (Mac)
Hi Guys

So I decided my first project to be a simple turret game. "easy enough" and i think its going great so far, "bearing in mind i have only been using Windows GS for a few weeks now" but thanks to some tutorials and some insight from all of you, i am making some progress, however i still have some questions.

So.. here is the basic Game.

I have set up a basic Scene where i have two green blocks"Turrets" and Two Red Blocks "Enemies"

now for the 1st test i only had one enemy, that would move across the stage and by using the Magnitude Method By tshirtbooth i had my turrets firing bullet actors at my Enemy Actor on a timer every 1 second like so


---
Turret Actor

Rule

When All of the Following Happen
if "Self.Distance From" < 150

Do

Timer
Every 1 Second

Spawn Actor
"Bullet"
---

Perfect.

now i have run into two problems,

Question one
. now i have run into two problems, once i have more than one actor "Enemy" Depositing Location information into game.Pos X and game.Pos Y the "Turret Actors will fire only at the Second "Enemy" Actor. now i know the bug is caused by the two Enemy actors trying to deposit information into the same "Global attribute" what is the correct work around for this? do i manually creat several Attributes per actor or is there some system where a "Global" Attribute can be created automatically once the " Enemy Actor is spawned and then having the "Turret Actors" Search all these parameters?

Question two
In my previous post i found that i could make an attribute local ie to the Actor itself, that said

If this actor collides with bullet, change Self.Enemy Health to Self.Enemy Health - 10 ,
and
if Self.Enemy Health ,=0, Destroy!

:D yay it worked

however when used in conjunction with the Timer and Spawn Actor Rule on the "Turret Actor" i found the the bullet wouldn't stop spawning, how do i get the timer to stop once the actor is Destroyed "dead" ?

Thanks in advance

Dane

Comments

  • DaneVincentDaneVincent Member Posts: 7
    ok so i did some searching and discovered that if i use a constrain attribute on my enemy health where if game.enemy health > 0 Timer, every one second spawn bullet etc, till the enemy is out of range or is dead, but that just brings me back to my first question about storing more than one actors information in the same Game. attribute Oo
  • DaneVincentDaneVincent Member Posts: 7
    Ok now i think this is a glitch, it seems that my bullets wont stop spawning again,

    If my enemy actor moves past the two turrets without being destroyed the turrets stop firing once out of range, however if i turn on the destroy rule the turrets fire at the point where the enemy actor was destroyed

    im confused
Sign In or Register to comment.