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.

DarkBASIC Discussion / My collision box doesn't work!!?? HELP!!

Author
Message
gopherbro 94
17
Years of Service
User Offline
Joined: 21st Dec 2008
Location:
Posted: 5th Jan 2009 02:15 Edited at: 5th Jan 2009 02:16
I am trying to make a collision box for this box. Although when I start the game I can go right through it. I understand the make object collision box command. But it doesnt work!!!!!!!!!!!!!!! HElp, my game is due on monday and it is Sunday. I need a fast answer!

code for box



code for the player

Yodaman Jer
User Banned
Posted: 5th Jan 2009 02:44
Do you have a main program loop, variables for the values in which the player's gravity and position are stored and such? Also, to make an object use box collision,


I was just using that in my program, so I copied/pasted it here.

You really need to provide much more information before anyone can help you out.

gopherbro 94
17
Years of Service
User Offline
Joined: 21st Dec 2008
Location:
Posted: 5th Jan 2009 03:11 Edited at: 5th Jan 2009 03:12
It tried the set object collision on 3, but that still did not work. My character goes all the way through it. For some reason it wont let me post the entire code, so ill put the gravity and player positions down. * also, there are steps in the game and spheres that the collision box works for. For some reason it just does not like my box.

player:




Gravity:
BN2 Productions
22
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 5th Jan 2009 06:34
It looks like you update the 1py# variable in the checks and position it there if you hit something, essentially saying:

If you hit something position yourself where you are. Then take input, move again and if you hit something, don't move, take input....etc etc. This makes nothing change. What you would need to do is have it place you at where you WERE BEFORE moving.

Ever notice how in Microsoft word, the word "microsoft" is auto corrected to be "Microsoft" but "macintosh" just gets the dumb red underline?

Login to post a reply

Server time is: 2026-07-05 15:02:48
Your offset time is: 2026-07-05 15:02:48