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 / Need 2D RPG tiles system help

Author
Message
Joesoftxl
22
Years of Service
User Offline
Joined: 8th Mar 2003
Location: United Kingdom
Posted: 8th Mar 2003 21:23
I need help making a 2d RPG with tiles and collision detection. I tried it with a sprite for walls and stuff you cant walk through and it worked but the characters got stuck and bounced away. I also tried with Arrays but it got really long
Howdy Fools
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 9th Mar 2003 00:51
I also tried with Arrays but it got really long

So? You think games are short?

Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy! Oh ya, and Tat has a plugin for that!
Joesoftxl
22
Years of Service
User Offline
Joined: 8th Mar 2003
Location: United Kingdom
Posted: 9th Mar 2003 00:56
I meant 20 + lines for a 4x4 grid but ...

Howdy Fools
Attreid
22
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 9th Mar 2003 01:14
but you can try to save your tiles' informations ( position, number of image, ... ) in an array, and save it
then, you can use only one code to load several maps

I'm following John, but I'm not john.
Lol, it is funnier in french
k0shi
22
Years of Service
User Offline
Joined: 30th Dec 2002
Location: Cyberspace
Posted: 9th Mar 2003 03:47
u can make layers
-the 1st layer being the background(being just 1 picture)
-2nd layer being the people,items ect..(all these things would b seperate because they move and stuff)
-3rd layer things that the 2nd layer go under like planes,tree tops,ect.(also just 1 pic)

If I could drop dead right now, I'd be the happiest man alive.
---------------------------------
.....:::<>-<K0shi>-<>:::.....
Joesoftxl
22
Years of Service
User Offline
Joined: 8th Mar 2003
Location: United Kingdom
Posted: 9th Mar 2003 12:12
I tried the sprite layers with a tank game whick worked but the tank got caught on edges and reversed with half of it in a wall. I'll try that array saving thing. I'm not relly sure how to check for collisions with certain tiles though.
(is that how you spell though?).

Howdy Fools
Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 9th Mar 2003 18:08
Its easy. You make a grid using an array
dim grid(width,height,properties)
properties being different items that can go on the tile. For example say that if grid(width,height,1)=1 means that a character is on a certain grid spot. You move him left, thus changing the last position to grid(width,height,1)=0
and the new position to grid(width,height,1)=1. Now lets say grid(width,height,2)=1 means theres an obstacle on that grid square. You test if there's an obstacle on the grid square you want to move to, if there is, you dont move, otherwise, you do.

Whatever I did I didn't do it!

Login to post a reply

Server time is: 2025-05-16 11:24:28
Your offset time is: 2025-05-16 11:24:28