Dragonfly Q&A

Vertical Saucers?

0 like 0 dislike
So part of my mod involves me having saucers that move vertically up the screen.

I can make them do that, but for some reason when they hit the top of the screen, they don't call out();

I figured "Alright, maybe OUT_EVENT doesn't cover that, so let's instead  write a STEP_EVENT and make it check each step if the Saucer's Y is less than 0 and just call out.

That doesn't work either.

In addition to that, whenever I quit the game I get some sort of weird error.

I know I'm pushing my time, but I've already pretty much got everything  else done. I just need this last thing to work.
Dragonfly version 4.2
asked Sep 2, 2016 in Tutorial by ErikCerini

1 Answer

0 like 0 dislike
Saucers will receive an out event each time they leave the game world (the screen, in Saucer Shoot).  There is nothing functionally different about a saucer leaving the screen on the left versus the top. To verify this is happening, reduce your code to a small case (e.g., one saucer), have it going up, and check via writeLog() messages in the eventHandler().

<p>I'm guessing you have some other logic issue in the event handler where the OUT_EVENT is received, but is being otherwise ignored.  Put a log message write at the top of the eventHandler() to print event type for your 1-saucer test case above.  Then, trace your code carefully down.  You can send us (me + TA) your Saucer code if you can't find the problem.
answered Sep 3, 2016 by claypool
So I managed to fix the issue with the saucers not respawning, but I'm still getting some error about writing to a location I don't have access to.

I've already submitted my asignment (with the non-working saucer respawn), but I can't seem to make it not crash after the game ends.

That being said, I included my mod as a separate game mode, and it only crashes during my mod. So it must be something new that I added.
More information about Dragonfly can be found on the Dragonfly Home Page.