Hi there, I'm trying to make lives on a game project.
It's a charizard flying avoiding two 'bubbles', I'm trying to get him to lose a life everytime he touches one.
I've tried numerous ways of getting it to work,
[scratchblocks]
when gf clicked
say 'avoid the bubbles!' for 5 secs
set Lives to 3
If touching bubble1
set lives to lives = -1
If touching bubble2
set lives to lives = -1
If lives = 0
think 'Game Over'
I've also tried making the bubbles the same colour and using if touching the colour, I have tried to make it lose lives if the bubbles touch charizard.
Thought it might be a problem with the sprites so stopped them changing costume and changed them entirely to no avail.
Offline
embles wrote:
Hi there, I'm trying to make lives on a game project.
It's a charizard flying avoiding two 'bubbles', I'm trying to get him to lose a life everytime he touches one.
I've tried numerous ways of getting it to work,when gf clicked say [avoid the bubbles!] for (5) secs set [Lives v] to (3) forever If (touching [bubble1 v]?) change [lives v] by (-1) wait until <not (touching [bubble1 v]?)> end If (touching [bubble2 v]?) change [lives v] by (-1) wait until <not (touching [bubble2 v]?)> end If <(lives) = (0)> think [Game Over] endI've also tried making the bubbles the same colour and using if touching the colour, I have tried to make it lose lives if the bubbles touch charizard.
Thought it might be a problem with the sprites so stopped them changing costume and changed them entirely to no avail.
The problem is that you had set lives to -1 and not changed it by -1 whenever you touched a bubble. Also, you forgot to add a wait block to make sure that you didn't instantly lose the game by touch a bubble once. Anyway, I edited your scripts above to make them work.
Anyhow, I hope that this helps!
Last edited by ErnieParke (2012-10-22 21:44:11)
Offline
embles wrote:
Ah that's great thanks, works perfect now.
Well that's good. And your welcome!
Last edited by ErnieParke (2012-10-23 06:38:08)
Offline