Undone changes but still wont run?
Posted: Thu Dec 08, 2011 12:26 am
Hi,
Only been using LiveCode for about two hours and very new to this, have some php and asp experience but that's about it.
I am following the rocket game introduction lessons and managed to get the rocket to go up and down when the mouse was down and not down.
I then set up a global variable myspeed and added 1 to myspeed each update and the little rocket rapidly sped up and shot to the bottom. All was working, ITS ALIVE!!!!
I then tried to get clever and add a max to myspeed - so I added IF myspeed was > 10 then nothing, else do the last bit of code - add the 1 to myspeed to get a maximum speed but I spelt the "else" as "eelse" so it didn't work, I quickly changed it back to "else" and it still didn't work, so I undid adding the last "if myspeed > 10" to go back to the code that was working a few minutes ago but the little rocket still wont move! All I did was click undo a couple of times.
I have tried undoing back more to see if I can just get the rocket to drop but its not working. I have re-done the changes and adjusted the code lots now trying to make it work but I have screwed up the engines on the little rocket ship. It seems as if I need to reset or make it forget about the maximum speed variable "eelse" spelling mistake but I don't know what to do.
Can someone help? Thank you very much in advance!!!
Only been using LiveCode for about two hours and very new to this, have some php and asp experience but that's about it.
I am following the rocket game introduction lessons and managed to get the rocket to go up and down when the mouse was down and not down.
I then set up a global variable myspeed and added 1 to myspeed each update and the little rocket rapidly sped up and shot to the bottom. All was working, ITS ALIVE!!!!

I then tried to get clever and add a max to myspeed - so I added IF myspeed was > 10 then nothing, else do the last bit of code - add the 1 to myspeed to get a maximum speed but I spelt the "else" as "eelse" so it didn't work, I quickly changed it back to "else" and it still didn't work, so I undid adding the last "if myspeed > 10" to go back to the code that was working a few minutes ago but the little rocket still wont move! All I did was click undo a couple of times.
I have tried undoing back more to see if I can just get the rocket to drop but its not working. I have re-done the changes and adjusted the code lots now trying to make it work but I have screwed up the engines on the little rocket ship. It seems as if I need to reset or make it forget about the maximum speed variable "eelse" spelling mistake but I don't know what to do.
Can someone help? Thank you very much in advance!!!

Code: Select all
local sGameRunning
global myspeed
put 1 into myspeed
on updatescreen
if sGameRunning then
if the mouse is not down then
if the bottom of image "rocket" +50 < the bottom of this card then
set the top of image "rocket" to the top of image "rocket" + myspeed
end if
else
if the top of image "rocket" > the top of this card then
set the top of image "rocket" to the top of image "rocket" - 10
end if
end if
end If
end updatescreen
on startGame
activateScreenUpdates
put true into sGameRunning
end startgame
on stopgame
put false into sGameRunning
set the top of image "rocket" to the top of this card
end stopgame