Issue with actor spawning
polimerjones
Member Posts: 50
In my scene i have an actor spawn another actor. the new actor instantly has its velocity changed to move to the left. if the new actor hits anything it gets destroyed and the game goes back to level select. when you start the scene again every so often the spawned actor will go up or down instead of going left. how can i fix this?
Comments
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
actor1
after 0 sec spawn actor2
actor2
after 4 sec change velocity to 0 (heading right) at 25 (speed)
if actor2 collides with any actor3
then go to level select
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
i do have one more question if you have the time.
the same actor two i have setup to check direction of movement every 2 seconds. (the two seconds is based on the fact that the game squares are 50 pixels and the actor speed is 25)
if during game play the speed is adjusted how could i adjust the time in which to check.
i have tried constraining self x + y to "speed" and telling actor2 to check every 50/"speed" but for some reason that doesnt work. got any other suggestions.
thanks in advance. if its to much trouble is appreciate the assistance already given.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
the problem with this is that if i change actor2's speed to lets say 50 then it would only need 1 second before it checked again.
as ive said i have tried 50/(x+y) which should be 2 if moving x=25 and 1 if x=50 but it doesnt.
If your squares are 50 pixels and also touching (i.e. 50 pixels apart from each other), you would do
When game.ZERO=mod(self.position.X,50) --> [behaviors]
This will work as long as your actor isn't moving at a very high speed because then it will skip over pixels while it moves.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User