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 / simpe -health collision?

Author
Message
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 11th Jan 2006 01:15
how do i make it so when the player character hits the enemy object the
players health variable goes down?

thanks,
-Marlin Studios

O
M
G!
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 11th Jan 2006 02:08
If object collision(player#,enemy#)
dec health#,amount#
endif
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 11th Jan 2006 03:23
it works but i have to turn and get right next to it and position myself
perfectly to get my health to go down. (probably becuase my collision sucks).

O
M
G!
TKsFox
19
Years of Service
User Offline
Joined: 25th Nov 2005
Location: No no no - Its not the Cyberspace
Posted: 11th Jan 2006 13:50
Use another model for collision.



that one should work much better - if it wont just create a sphere arround player

It's me...
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 11th Jan 2006 16:22
hmmm. could you give me a code snippet to place a larger sphere around the character.
but it doesent collide. so it will make my collision better.

O
M
G!
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 11th Jan 2006 23:17 Edited at: 11th Jan 2006 23:24
is this the effect you're looking for?



EDIT: use arrow keys to move

My Modest System:
Athlon XP1800+, Windows XP+SP2, Soyo K7V Dragon+ MB, 1.5Gb 333 RAM, ATI Radeon 8700LT (128Mb), Drivers and Updates Kept Current
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 13th Jan 2006 05:40
how can i implement that into my code:



please help

O
M
G!
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 13th Jan 2006 21:18 Edited at: 13th Jan 2006 21:31
since you're checking for collision vs all other objects at once, the 2nd player object (extended collision object) will always collide with your player object. you can alter this line in your code to exclude the extended collision object.

change this:


to this: (where ExCO is your "Extended Collision Object")


you'll also have to run a check for ExCO by adding another line like:



and don't forget to move the 2 objects together.
at the same time, if you're just using the extended object to get a different type of collision (a wider collision radius for your player), then just check ExCO and cause it's collision detection to move the player object. aka, you could turn the collision OFF on the player object, relying solely on ExCO.

you get the idea

My Modest System:
Athlon XP1800+, Windows XP+SP2, Soyo K7V Dragon+ MB, 1.5Gb 333 RAM, ATI Radeon 8700LT (128Mb), Drivers and Updates Kept Current
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 13th Jan 2006 22:59
thats odd. it doesent change anything. i must ask you one more favor.
feel free to turn it down but it would help me SO much. could you implement
that into my code so it works, so that collision is off on "enemy"? It would help me SO much bro. please.

thanks in advanced.
here is my code:



O
M
G!

Login to post a reply

Server time is: 2024-11-27 07:38:13
Your offset time is: 2024-11-27 07:38:13