Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 22 Feb 2013
Offline Last Active Apr 07 2013 07:26 AM

Topics I've Started

How do I write an isometric 2D engine?

06 April 2013 - 05:27 AM

A little about myself:

I've programmed a couple of tiled 2D RPGs already, using SDL. I'm also familiar with some "advanced" math, like transformation matrices and what not.


On to the problem, then!


I want to create an isometric 2D RPG game, but I have no idea where to start. I'm familiar with the concept as such, but I have no experience whatsoever with the implementation. For instance, SDL has a function called SDL_BlitSurface() that blits rectangles, that I've used to copy the texture onto the map. How I'd do the same with an isometric tile, however, I cannot fathom.


So, where do I begin? I've searched for both tutorials and actual code, but found nothing that left me any wiser.

How to handle scripted events?

22 February 2013 - 05:09 AM



I'm currently writing my first proper 2D game (integrated in a custom built engine) using C++ and SDL. I have a question about how to script certain events though. The engine itself is state based.


My game state is made up like this:

class PlayState : State
    Camera* camera;
    Player* player;
    Map* map;

In turn, the map is primarily a manager of tiles (Tile*** tiles; which get initiated in accordance with the map file).


Now to the problem! When I step on, let's say tile [25][100], I would like the game to change to a certain state (declared either in the map file or in some script). What's the best way to do this?


PlayState holds a pointer to the engine, and it would be possible for it to pass a ChangeStateEvent to it, but then I have clutter the map file with both info about what event to send and possibly a parameter to the same (i.e. ChangeStateEvent, Cutcene(cutscene nr 725)). Instead I was thinking about having some kind of script trigger every time I step onto a new tile and check if the tile is a trigger tile. If so, the script will handle everything necessary to view the cutscene.


So, what do you suggest? Is scripting the way to go, or am I completely off?



I own all of the code myself (and the game art is all Creative Commons licensed), and wouldn't mind sharing it if necessary (it'll most likely cause a headache for the more advanced game devs though).