Game Crash When Spawning Actor[SOLVED]

bcgreen24

  • Posts: 6
Hi, all-- I'm trying to spawn an actor of a certain type off-screen when other actors of the type are killed.

I have a 'star' actor that is killed after leaving the screen, then have an 'actor killed' event that is supposed to spawn a new star (see attached image).  But-- what's happening is that just as a star is about to leave the screen, the game locks up and I have to force quite the Flash player.  When I temporarily detach the 'create star' block from the 'when killed' block, the game no longer locks up.

Sooooo there's something going on with the 'create star' block that I don't quite undertand...any ideas?

Thanks!
Bryan


« Last Edit: July 20, 2016, 03:03:32 pm by bcgreen24 »

LIBERADO

  • *
  • Posts: 2719
I have a 'star' actor that is killed after leaving the screen
For this reason, each time a new star is created offscreen, it is immediately killed.
So, stars are continuously created and immediately killed, and this makes the game to lock up.

« Last Edit: July 20, 2016, 08:57:42 am by LIBERADO »
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

bcgreen24

  • Posts: 6
DANG IT! I knew it had to be something stupid. 

Thanks, LIBERADO!

Bryan

bcgreen24

  • Posts: 6
Well, I did a test where the new star is spawned ON-screen, and the game still locks up as it did before...

See attached screenshot...

Bryan

LIBERADO

  • *
  • Posts: 2719
Keep in mind that the x,y coordinates where each star is created are relative to the scene, not the screen.
So, if you have moved the camera, then the stars could be being created off the screen.

By the way, the "kill [Self]" block must be placed beneath the "create [Star]" block.
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

bcgreen24

  • Posts: 6
Ah HA! Putting the 'kill self' block under the 'create star' did the trick.

Thanks again, sir!

Bryan