Trying to explode a submarine using a sprite

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

chris25
Posts: 354
Joined: Tue Oct 08, 2013 9:32 pm

Re: Trying to explode a submarine using a sprite

Post by chris25 » Fri Nov 29, 2013 7:34 pm

Hi Sparkout, just going through what you sent now. But to quickly answer your question about this:


on updateScreen
   if tGameRunning is true then
      -- we check the tGameRunning flag and only do the game updates if it's running
      moveBox
      DropMines
      collisions
   end if
   put true into tGameRunning
   -- why do you reset the game running flag to true here?
end updateScreen



I was having problems for some time with getting the game going it was crashing getting stuck, etc . Then, while searching for possible answers I stumbled on another casual post I came across and an unrelated question about getting a timer to work. He had written this:

global gGameRunning

on mouseUp
if gGameRunning is true then
add 100 to field "score"
send "mouseUp" to me in 1 second
end if
put true into gGameRunning
end mouseUp

so out of instinct (because I saw that nothing was entering into sGameRunning in the debugging) I decided to move it from its original position and put it where you see now, then everything started working normally. But as to why? Nope, I have absolutely no idea, I simply do not know enough to know this sort of thing yet.


EDIT: Well I suppose really I ought to just put this on a shelf for about 6 months. I have to accept when I've been beaten. I guess building a simple little game is actually far more complex than writing an app and Iv'e done three of those. The simplicity is quite deceiving really I've been two weeks at this. So back to the drawing board with another fresh idea and another app exercise.

Thankyou Sparkout, your code is not wasted at all.
kind regards
chris

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Re: Trying to explode a submarine using a sprite

Post by SparkOut » Fri Nov 29, 2013 9:32 pm

You aren't beaten yet!

chris25
Posts: 354
Joined: Tue Oct 08, 2013 9:32 pm

Re: Trying to explode a submarine using a sprite

Post by chris25 » Fri Nov 29, 2013 9:44 pm

Yes I am...and it's infuriating...

Post Reply