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! / zelda retro game collision problem

Author
Message
Red general
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: United Kingdom
Posted: 11th Feb 2003 22:29
I've been trying a zelda game for the competition

However when I collide my zelda into a wall, he is stuck. How do I get to be able to back away. I have tried to do like the example does, but that does not help.
Here's the code so far
My computer melts regulary - perhaps it likes being fondue
warzog
21
Years of Service
User Offline
Joined: 13th Oct 2002
Location: United States
Posted: 12th Feb 2003 00:49
Sounds like you're changing the OLDX# and OLDZ# before it detects the collision.

Change:
oldx#=x#
oldz#=z#

to:

if sprite collision(1,1999)<=0
oldx#=x#
oldz#=z#
endif

That should fix it.
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 12th Feb 2003 18:06
Array collision is what you need my friend. You wan't sliding collision and super fast wall collision you need to look at using your level data for the collisions. I could show you an example later if your interested, but array collisions are the fastest possible solution to your problem (like what'll happen when your checking a hundred sprite collisions!).


Van-B
Dazzy
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 12th Feb 2003 20:22
I'd suggest u use a tile based system for this! but that is only my preference.

Dazzy
DB IRC Chat irc.hashnet.org port 6667 #darkbasic
Red general
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: United Kingdom
Posted: 13th Feb 2003 13:36
That sounds interesting Van B, the problem was solved by warzog, but as there will be many hundreds of sprite chekcking in the game, I think you are right, and I would like to see an example of that.

THANKS
RED GENERAL

My computer melts regulary - perhaps it likes being fondue
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 13th Feb 2003 15:18
No problem, I'll post an example tonight, but it's easy as pie to impliment, especially if you use a tile system like Dazzy mentioned - like your whole level can be stored in a 2D array, then this can be used to check collision and draw your level.


Van-B
actarus
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location: 32 Light Years away
Posted: 13th Feb 2003 15:20
someone had made a very good Tile Editor useable for DB...I think it was eraser...Haven't seen in a long time tho.

Just remember that you're standing on a planet that's evolving
And revolving at nine hundred miles an hour!
actarus
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location: 32 Light Years away
Posted: 13th Feb 2003 15:22
If anyone needs it I think that's the one...Looks like it was made in DB after all.

http://www.southcom.com.au/~eraser/darkbasic/

Just remember that you're standing on a planet that's evolving
And revolving at nine hundred miles an hour!
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 15th Feb 2003 03:48
Have a look at this code, you should be able to adapt it, it's really straightforward.



Hope this helps.


Van-B
Bishop
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 25th Feb 2003 04:03
Link is the main character, not zelda=)
anyways, back to my tower...

"When you were born, you cried and the world rejoiced. Live so when you die, the world cries and you rejoice."

Login to post a reply

Server time is: 2024-04-23 18:31:24
Your offset time is: 2024-04-23 18:31:24