Search code examples
javadictionaryside-scroller

Java Development: How To Draw Scenes Like In Rayman


I want to create a basic side-scrolling game in Java like the 1995 game Rayman.

If you haven't played Rayman, here's a screenshot of what I mean: http://www.iphone-gamer.net/images/jump-feb20-rayman-1.jpg

More specificly, I'm wondering how exactly they draw the maps, like the green land for instance, is it made up of lots of say 100 x 100 images with different pieces of land (different angles, height etc.) that are tiled horizontally to form a long piece of land, or is it created in a different way?

Also could someone point me in the right direction or give me a basic example of how I'd draw a map like in Rayman?

I have the animation loop ready and could probably sort out the collision detection and get a little player created, its just the maps - I don't know how I'd make maps like Raymans, and no I'm not trying to copy the game, just make one similar and much smaller to it.

Thanks for reading, Alex :)


Solution

  • I don't know about this particular game specifically, but there's generally two approaches I'm aware of. The first is to write custom map files which rather than working via images, work with the location of objects and terrain, set properties for that terrain (friction, elasticity etc.) and so on. The program then renders the map based on smaller image files making up the objects in the world, and probably applies a background image too.

    That's arguably the better approach, but it is more complicated. If you just want to use an image and scroll that to start with there's nothing wrong with it, but just make sure your image isn't so large you run out of memory!

    As an aside, Greenfoot might be good if you're just getting started with programming in general, it lets you create what you like in Java but a lot of the complicated stuff such as collision detection, double buffering etc. is already done for you.