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.

Newcomers DBPro Corner / Tiling Question

Author
Message
Derekioh
15
Years of Service
User Offline
Joined: 1st Feb 2009
Location:
Posted: 1st Feb 2010 18:42 Edited at: 1st Feb 2010 19:08
Ok, so i'm trying to recreate the Chrono Trigger game so i can learn how to do tiling, combat system, etc., the only problem is, the tiling is messing me up.

This is the room i'm trying to recreate (for testing proposes).
Edit: The pics now atttached.

Now my question is, how do i make it so when you (the character) hits the bed, you don't stop on a certain tile, but acually stop next to the bed. Would i have to make that bed a sprite? or would i have to use layers (don't know how to use layers by the way). I know this is a bit confusing, but if someone could help that would be great.

Attachments

Login to view attachments
Wreckka
15
Years of Service
User Offline
Joined: 31st Jul 2009
Location: My grandmothers basement.
Posted: 2nd Feb 2010 06:51 Edited at: 2nd Feb 2010 06:56
I'm not very experienced with creating 2d games, but I would assume you'd do a form of collision detection either way. For something like the bed, you could do a sprite, or if you wanted to save some space and effort, make a collision box instead. Same goes for the perimeter of the room. I would personally go with a method of setting it up so that your game would check the character's x and y coordinates and if they were either more or less than the x and y boundaries you set, you would make it stop you. Not sure if I helped at all, but hey, I tried
<EDIT>
I painted up your picture to give you a better idea of what I mean.

Green is the actual space of the map that you could walk in if there were no sprites to collide with.

Red is the sprites that you could collide with.

Blue is your x and y axis.

Enjoy my artistic skills, they don't shine very often haha

Making my way through life one line of code at a time...

Attachments

Login to view attachments
Derekioh
15
Years of Service
User Offline
Joined: 1st Feb 2009
Location:
Posted: 2nd Feb 2010 17:09 Edited at: 2nd Feb 2010 17:56
wow that was truely maginficent (lol). anyway, so would the floor be tiled but and walls be tiled and every other object be sprites?

P.S.- thanks for the explanination, i think i'll do that.
Wreckka
15
Years of Service
User Offline
Joined: 31st Jul 2009
Location: My grandmothers basement.
Posted: 3rd Feb 2010 01:47
I'm not exactly sure what you're asking, but I'm pretty sure you have the right idea. Just remember not all objects are actually sprites. Some are merely part of the background image with a collision box around it.

Making my way through life one line of code at a time...
wildbill
18
Years of Service
User Offline
Joined: 14th Apr 2006
Location:
Posted: 3rd Feb 2010 19:18
First let me say there are so many ways to do sprite collisions you could get really deep into the water.

Since you are using tiles though, one of the easiest ways is to make a collision mask. It actually might be the oldest way too. Make the bottom layer of your tile engine the collision layer. If that tile is red or whatever color you want you have collided with something. Just check the pixel color at the cardinal compass directions from your sprite, if its red you can not move that direction. One of the benifits of a collision mask is that you can make it whatever shape you want and it will still work.
Derekioh
15
Years of Service
User Offline
Joined: 1st Feb 2009
Location:
Posted: 3rd Feb 2010 21:47
@wildbill:
I'm not sure i follow on what you mean (sorry i'm stupid), could you give me and example?
Derekioh
15
Years of Service
User Offline
Joined: 1st Feb 2009
Location:
Posted: 6th Feb 2010 15:19
Could someone explain or show how i could use a "collision mask" for my game because i'm not even sure i know how to do layers, let alone a collision mask.
Derekioh
15
Years of Service
User Offline
Joined: 1st Feb 2009
Location:
Posted: 7th Feb 2010 02:51
Anyone?

Login to post a reply

Server time is: 2024-11-23 19:29:01
Your offset time is: 2024-11-23 19:29:01