Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (616)
Games in Android Showcase (173)
games submitted by our members
Games in WIP (659)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  borders within a background image...  (Read 1345 times)
0 Members and 1 Guest are viewing this topic.
Offline DavidBoBavid

Senior Newbie

« Posted 2006-12-31 14:14:50 »


I have a question regarding how to determine borders, or places you can't move, when you have a single image for a background.  In a game similar to, let's say some of the older 2d adventure games. The background was a static image, and the characters moved around on the screen, but obviously they were constrained to the 'floor' part of the image.

How is something like that achieved? Can I somehow use the colors of the floor to determine where I can move?  Do I need another image that's just black and white, that will give the walkable/nonwalkable areas of the screen?

Offline woogley
« Reply #1 - Posted 2006-12-31 14:45:02 »

most games like that use tilemaps, where the player is moving along a grid (where the grid cells are the same size or larger than the player). it is possible to use a collision maps to determine which tiles are allowed to be walked on, etc.
Offline oNyx

JGO Coder

Medals: 2

pixels! :x

« Reply #2 - Posted 2006-12-31 18:34:26 »

Adventure game systems usually use a special image (1bit) or several shapes (and you can only walk inside of those convex polygons).

You might want to take a look at AGS.

It gets more complicated if you want that there are some foreground bits, which can be in front of the player. But again it can be solved with a 1bit image. "Extract" the regions where the foreground bit is set and draw em back to front while using the lower edge of em (and of the player) for determining the order.

If you want extra neat (correct) antialiasing you'll need seperate images, which need to be placed into the scene with some kind of editor.

弾幕 ☆ @mahonnaiseblog
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline DavidBoBavid

Senior Newbie

« Reply #3 - Posted 2006-12-31 21:37:42 »

thanks woogley... i had thought about that, but i really wanted to just have a single image rather than worry about tiles..

onyx: what do you mean by 1bit image? you mean something that's just a black and white regions where you can or can't move? the AGS thing looks neat, but i'm looking to do it all myself, rather than use a tool.. but thanks, though.
Offline oNyx

JGO Coder

Medals: 2

pixels! :x

« Reply #4 - Posted 2006-12-31 22:27:27 »

>what do you mean by 1bit image? you mean something that's just a black and white regions where you can or
>can't move?

Yes. But it could be red/blue or black/transparent, too. (Black/white makes more sense tho.)

The advantage of doing that via images is that you don't need to write extra editors for that.

Oh and that foreground solution, I outlined above, has apparently some limitation. Areas with different Z-values (determined by the lower edge) can't overlap. Well, you could work around that by using different colors (and letting the stuff which is closer to the cam overlap the stuff which is farer away).

edit: Btw the reason why I pointed at AGS is because you might want to take a look how they solved that stuff.

弾幕 ☆ @mahonnaiseblog
Offline DavidBoBavid

Senior Newbie

« Reply #5 - Posted 2007-01-01 16:46:12 »

ahh.. yeah i see what you mean.. thanks again for the link and tips. Smiley
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Coldstream24 (16 views)
2015-09-03 00:41:28

Andrew_3ds (27 views)
2015-09-01 19:08:10

afikri (18 views)
2015-08-31 09:30:22

afikri (25 views)
2015-08-31 09:30:07

afikri (13 views)
2015-08-31 09:27:24

afikri (16 views)
2015-08-31 09:26:40

Roquen (30 views)
2015-08-29 11:30:54

GamerC4 (36 views)
2015-08-22 20:38:50

GamerC4 (33 views)
2015-08-22 20:37:18

GamerC4 (40 views)
2015-08-22 20:37:01
HotSpot Options
by Roquen
2015-08-29 11:33:11

Rendering resources
by Roquen
2015-08-17 12:42:29

Rendering resources
by Roquen
2015-08-17 09:36:56

Rendering resources
by Roquen
2015-08-13 07:40:51

Networking Resources
by Roquen
2015-08-13 07:40:43

List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!