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.

2D All the way! / 2d collision

Author
Message
Redstar
16
Years of Service
User Offline
Joined: 7th Mar 2008
Location:
Posted: 21st May 2008 04:07
AAAAAAHHHHH. I AM GETTING TIRED OF LOOKING!!! SO I WILL JUST SAY IT MYSELF........(sorry)


anyways

i really need help with colliding, i love 2d games and i think 3d games are alright...but hard to make, but i think 2d are better. back to the subject now. i need help collinding. i am trying to make a stick figure game(go figure). i already made him to a stick and he moves left and right(kinda funny actully) next i tried putting a 2d box(or square) in the game and tried everything for him to collide it. he just goes right threw it! i have been trying to figure this out for one month now. please someone help.


few things to know

1. i use DARK BASIC (not pro or 2 or 3 or 100) but i will soon get pro hopefully during the summer.(only got acess to DB at school)

2. one more quetion, when i jump i start to freak out like it goes up and down to fast. but that is just another quetion for later....
BiggAdd
Retired Moderator
19
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 21st May 2008 09:34
http://forum.thegamecreators.com/?m=forum_view&t=91174&b=4

Read the PDF that the user "Sadsack" posted. Might be able to help you.

Redstar
16
Years of Service
User Offline
Joined: 7th Mar 2008
Location:
Posted: 21st May 2008 21:10
dang it i hate links>.< fine i will check it

Redstar all the way!!!
Redstar
16
Years of Service
User Offline
Joined: 7th Mar 2008
Location:
Posted: 27th May 2008 22:04
eh, dident help. just got bored of reading it i guess.

what i really need to know is how to make a code for 2d collision.

i dont know anything about x,x or (x,(sjfjlas) or something like that.

i want to know what to do. like

collision setting 1,1,1,1 or something like that. nothing compucated....complicated....(did i spell it right?)

Redstar all the way!!!
Deego
15
Years of Service
User Offline
Joined: 21st May 2008
Location:
Posted: 29th May 2008 00:17
I'm just starting out with coding but I think I can help here. I use DBPro, so things may be different.

Use the command variable=sprite collision(boxsprite,charactersprite).

Your variable = 0 when the sprites aren't colliding, and the variable = 1 when they do collide. Then set up a logic loop to perform actions when the variable = 1.

That just solves detecting the collision. You need to write a code so that when the collision happens, you can't move towards the box any more. For more information, look at Code Dragon's example in BiggAdd's link.

Read the tutorials. They will help you, even if the subject isn't what you are working on.

Login to post a reply

Server time is: 2024-05-04 18:49:00
Your offset time is: 2024-05-04 18:49:00