Game Development Community

Where may i found some RPG examples scrolling?

by Matthews_30 · in Torque Game Builder · 10/11/2005 (12:46 pm) · 1 replies

I want to try to create a tile scrolling 2D map. The map must move to up, down, left and right accordingly to the chacracters movement (diablo 2 like).

any samples?

thanks,

matt.

#1
10/11/2005 (1:11 pm)
Well, once you go through the BasicTutorial.pdf, most of you questions will be answered. It contains how to move a player up, down, left, right, load tilemaps that you construct in the tileeditor, etc although it is a side scroller, so it won't be top-down rpg styles, so obviously get ready to bust out the tile editor and start poundin' on some maps, lol.
Moving tilemaps around isn't hard at all with T2D (actually, it's ridiculously intuitive). Tilemaps are just handled like sprites and therefore can be moved around like sprites, but it's better to pan around tilemaps with a mounted camera. T2D does all this for you with some basic setup and out-of-the-box function calls. Something like:

// $player is an fxAnimatedSprite2D, but you can mount the
// camera to anything as long as it's part of the scenegraph
sceneWindow2D.mount($player);

will mount the camera to the object you feed it, keeping that object in it's center. Then (assuming you have your keyboard input setup) when you do something like:

// somewhere else an 'onKeyDown()' has been activated
$player.setVelocityX(10);

the camera will just follow the player, so you don't need to move the map.