Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / help with life

Author
Message
dark donkey
18
Years of Service
User Offline
Joined: 4th May 2006
Location:
Posted: 18th Nov 2006 13:15
hi, i am just trying to creat two cubes you contol one and if you hit the other one your life goes down by 50 and when it = 0 i whant the program to end

also the cube disapeers when i move but thats not that inportant the health is

i have made the health with this piece of code life=100 then ive said if object 2 collides with object 1 i whant health to be -50 but it dosent work

thanks!

Bozzy
18
Years of Service
User Offline
Joined: 10th Sep 2006
Location: Birmingham, UK
Posted: 18th Nov 2006 13:28 Edited at: 18th Nov 2006 13:29
Hi, i think you need to put the life=100 out of the loop for it to work lol

Right now the life keeps on going back to 100 at the beggining of the loop so it will basically stay the same, or at least variate between 50 and 100
Panda lover
18
Years of Service
User Offline
Joined: 22nd Feb 2006
Location:
Posted: 18th Nov 2006 20:31
Yer tke the life=100 out of the do-loop and put it before the do and the code should work fine then
Gamedesign er20
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: The one place you would never look...
Posted: 19th Nov 2006 02:47
don't forget to make
Quote: "life=lfe-50"
life=life-50

Cocacola and Pepsi aren't that differnt. Deal with it.
Sunflash
19
Years of Service
User Offline
Joined: 28th Jun 2005
Location: Seattle, Wa
Posted: 19th Nov 2006 03:10
lol, I was just going to comment on that
Another hint, instead of going to a sub rutine when the cubes health reaches zero, just type the command "exit". This will exit the loop currently being processed (the do loop). SO the updated code should be:



"I must tell the Queen that a robin has seen Cludd hanging about. No, thats not right. I must tell the robin that Cludd has been hanging the Queen..." -Mossflower.
dark donkey
18
Years of Service
User Offline
Joined: 4th May 2006
Location:
Posted: 19th Nov 2006 11:12
thanks!

Login to post a reply

Server time is: 2024-11-27 04:39:27
Your offset time is: 2024-11-27 04:39:27