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! / Best way for tile system?

Author
Message
They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 30th Apr 2005 11:25 Edited at: 30th Apr 2005 11:26
I know this question is the most asked question of the century, but I was wondering if it was ok to use an array, and put 0's and 1's to represent empty and solid tiles. Then I could make the game read the array and paste 32x32 tiles on the 640X480 Window. My question is, how would you go about doing this... and is this even the most efficient way to do it? or would it create slowdown? Or Should I use a Data Statment instead?


Here's what i Started with:



Stan: OH MY GOD! THEY KILLED KENNY
Stan's Grandpa: You Bastards!
Kyle: HEY! ><
FakeBlood
22
Years of Service
User Offline
Joined: 18th Nov 2002
Location: Alabama, United States
Posted: 30th Apr 2005 12:00
You could also use the DATA command. A simple example (the same i have in my tile editor for now)

This way you can draw out your map and can kind of see what it will look like.

They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 1st May 2005 01:35 Edited at: 1st May 2005 01:51
Wow Thanks, Thats a lot easier than what i was doing. I got An Excel Worksheet and mapped the level onto it. Then i took the coordinates and put in the ones, since the rest of the array would be 0 by default. But this way is waaay better. You saved me a lot of time Thanks.

But why is there an EndIf at line 18?


EDIT: I took it out and it worked, but... the level doesnt show until i move the window... is there any way to make it render without moving the screen?

Stan: OH MY GOD! THEY KILLED KENNY
Stan's Grandpa: You Bastards!
Kyle: HEY! ><
EddieB
20
Years of Service
User Offline
Joined: 29th Sep 2004
Location: United Kingdom
Posted: 1st May 2005 03:17
Hey

Thanks that helped me aswell, ( I am just starting the 2D side ). Also I never have used data statments before.

Many Thanks
Eddie

FakeBlood
22
Years of Service
User Offline
Joined: 18th Nov 2002
Location: Alabama, United States
Posted: 1st May 2005 09:19
No problem, oh the Endif was there from a part of code I removed. Sorry guess I forgot to remove that

It should load right away, does for me. Not sure about what's causing that.
pizzaman
21
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 2nd May 2005 01:28
Have a look at this code it might help you.



Bear in mind this is only one way to do it, and that this code is just the basics.

They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 3rd May 2005 10:48
that looks more complicated lol. I figured out the whole problem where it doesnt show up. I had to put a Sync in my loop


lol I'm slow

Stan: OH MY GOD! THEY KILLED KENNY
Stan's Grandpa: You Bastards!
Kyle: HEY! ><
FakeBlood
22
Years of Service
User Offline
Joined: 18th Nov 2002
Location: Alabama, United States
Posted: 3rd May 2005 11:29 Edited at: 3rd May 2005 11:30
good

and yes pizzaman's is more complicated because it does much more than simply load the images. It scrolls the map and has player control etc..
definitely a good source to keep around for when you need it.
They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 4th May 2005 05:34
=O then I'll save it lol For now I'm gunna make a demo level with no scrolling though . I might use it later.

Stan: OH MY GOD! THEY KILLED KENNY
Stan's Grandpa: You Bastards!
Kyle: HEY! ><
They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 4th May 2005 11:09
Ok then... I have another Problem using this... I got my old animation code back from my old thread, and implemented it into this new program, but when I put the Sprite in, it makes the background blue. I added the transparency and now it makes the Background dark. Here's the code and a sprite sheet. I tried to figure it out, but i still couldnt get it to work..

Stan: OH MY GOD! THEY KILLED KENNY
Stan's Grandpa: You Bastards!
Kyle: HEY! ><

Attachments

Login to view attachments
zenassem
22
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 5th May 2005 03:27 Edited at: 5th May 2005 03:36
@They Killed Kenny,

I was working on a RPG 2d tilebased snippet a while ago. It is what actually prompted me to write the 2d Tutorial stickied above in this board, (that I have been away from for a while - Though I will be returning to and cleaning up shortly). I don't believe that it's too hard to follow, as I purposely tried to code it so that it could be part of a tutorial. I have posted this before, and have probably used it to death to explain a simple but effective layerd map systme, animation, and battle scenes. I'll repost links to the media, some of which is form RPG maker 2000 and other basic tilese that came with DBC. Let me know if it helps you. It's not the best implementation, as movement and collision is tilebased rather than a polar coordinate system. Let me know if can clear any of it up, and if it's what you are after.



images coming in the next 10 minutes














This is basically what the overworld map looked like...






~zen


zenassem
22
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 5th May 2005 06:57 Edited at: 5th May 2005 06:59
@killed kenny,

The blue background should be solved by turning backdrop off.

command:
backdrop off

Did you include that in the code?

Also after you are finished creating sprites (or in the main loop, if your redrawing the entire screen each frame)

use the

cls 0

command to clear the screen to black.


~zen


They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 12th May 2005 07:32
Oh. =P okay thanks. Glad to hear you're back and doing the tutorial again... we were wondering where you went =P

Stan: OH MY GOD! THEY KILLED KENNY
Stan's Grandpa: You Bastards!
Kyle: HEY! ><

Login to post a reply

Server time is: 2025-05-19 00:20:26
Your offset time is: 2025-05-19 00:20:26