Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (521)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (589)
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 1133 times)
0 Members and 1 Guest are viewing this topic.
Offline DavidBoBavid

Senior Newbie





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

Hi,

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?

Thanks,
David
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.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xFryIx (57 views)
2014-11-13 12:34:49

digdugdiggy (35 views)
2014-11-12 21:11:50

digdugdiggy (29 views)
2014-11-12 21:10:15

digdugdiggy (23 views)
2014-11-12 21:09:33

kovacsa (46 views)
2014-11-07 19:57:14

TehJavaDev (50 views)
2014-11-03 22:04:50

BurntPizza (50 views)
2014-11-03 18:54:52

moogie (65 views)
2014-11-03 06:22:04

CopyableCougar4 (63 views)
2014-11-01 23:36:41

DarkCart (149 views)
2014-11-01 14:51:03
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org 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‑gaming.org
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!