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 / Losing health little at time

Author
Message
kuljot
15
Years of Service
User Offline
Joined: 2nd Jan 2009
Location: sacramneto, ca united states
Posted: 20th Jun 2009 03:36 Edited at: 20th Jun 2009 03:59
Hi, once again i need help for my game again. if i use this code

What it does is continuassly take away health. I want it so even if the player is in collision with the second object that health is taken away and then after a short pause if the 2 objects are still colliding then more health be taken away. I dont want health to be continuassly be taken away. Please help and thanks in advance. I live in the U.S so i usually dont get asnwer until it is past midnight over here.

Gateway GT5628 Quad Core Desktop Intel Core 2 Q6600 2.4GHz Quad Core 3072MB RAM / 500GB 7200 SATA II Hard drive DVD RW 18X multi dual NVIDIA GeForce 8500GT ....
Pillarofire
20
Years of Service
User Offline
Joined: 31st Dec 2003
Location: Good Question, <looks around.>
Posted: 20th Jun 2009 03:59
Hmm, you should devise a timer, and then check the the timer for a change of 2 or greater seconds (2000ms).

so technically:

kuljot
15
Years of Service
User Offline
Joined: 2nd Jan 2009
Location: sacramneto, ca united states
Posted: 20th Jun 2009 04:11
Pillarofire thanks for the quick reply. That code creates a pause the first time collision occurs but if the player stays in contact with the secodn object or hits it again the score gets into the negatvies really really fast.

Gateway GT5628 Quad Core Desktop Intel Core 2 Q6600 2.4GHz Quad Core 3072MB RAM / 500GB 7200 SATA II Hard drive DVD RW 18X multi dual NVIDIA GeForce 8500GT ....
zeroSlave
15
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 20th Jun 2009 05:06
try this inside the loop:

Pillarofire
20
Years of Service
User Offline
Joined: 31st Dec 2003
Location: Good Question, <looks around.>
Posted: 20th Jun 2009 05:26
You could simply decrease the decrementing value; Change 15 to like 1 and if thats even too high, then maybe make a float that will be decremented by .001 or something and then decrement the health.
kuljot
15
Years of Service
User Offline
Joined: 2nd Jan 2009
Location: sacramneto, ca united states
Posted: 20th Jun 2009 07:38
Any aother ideas pelase, i seriosuly need help with this part.

Gateway GT5628 Quad Core Desktop Intel Core 2 Q6600 2.4GHz Quad Core 3072MB RAM / 500GB 7200 SATA II Hard drive DVD RW 18X multi dual NVIDIA GeForce 8500GT ....
Pillarofire
20
Years of Service
User Offline
Joined: 31st Dec 2003
Location: Good Question, <looks around.>
Posted: 20th Jun 2009 07:54 Edited at: 20th Jun 2009 07:57
Well you could try this:




EDIT: I fixed the horrendous formatting...
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 20th Jun 2009 09:33 Edited at: 20th Jun 2009 10:07


Quote: "after a short pause if the 2 objects are still colliding then more health be taken away."


change the 300 to whatever time interval you want.

edit i was missing the first hit. fixed. also, similar to what others posted here but i think this is closer to what you want and a little simpler. your mileage may vary


mike5424
15
Years of Service
User Offline
Joined: 30th Mar 2009
Location:
Posted: 20th Jun 2009 11:40
?

www.madninjas.co.nr we are mad and we are ninjas
bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 20th Jun 2009 20:19
more like



kuljot
15
Years of Service
User Offline
Joined: 2nd Jan 2009
Location: sacramneto, ca united states
Posted: 20th Jun 2009 21:22 Edited at: 20th Jun 2009 21:23
Thanks so muh i got that promblem solved just one more small promblem.

life=3
health=100
if health=0
life=life-1
position object 1,4,4,0 rem repositions player at beggining of the game.
endif
if life<0
end
endif




ok as soon as the health hits zero then what happens is the game immediately ends. for some reason it takes the lifes away 1 by 1 in less than a second. Any solutions here.

Gateway GT5628 Quad Core Desktop Intel Core 2 Q6600 2.4GHz Quad Core 3072MB RAM / 500GB 7200 SATA II Hard drive DVD RW 18X multi dual NVIDIA GeForce 8500GT ....
Databug
16
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 20th Jun 2009 21:34 Edited at: 20th Jun 2009 21:35
You also need to reset the health so it doesn't keep taking away life.



kuljot
15
Years of Service
User Offline
Joined: 2nd Jan 2009
Location: sacramneto, ca united states
Posted: 20th Jun 2009 23:16
Ok thanks guys for all the help you haven given me. Virtual Nomad your code worked the best for my situation thanks for everyones help. I hope this post helps other new combers like me.

Gateway GT5628 Quad Core Desktop Intel Core 2 Q6600 2.4GHz Quad Core 3072MB RAM / 500GB 7200 SATA II Hard drive DVD RW 18X multi dual NVIDIA GeForce 8500GT ....

Login to post a reply

Server time is: 2024-11-25 04:46:11
Your offset time is: 2024-11-25 04:46:11