Advertisement

Castle of the winds type rpg game

Started by August 13, 2002 12:04 AM
1 comment, last by pandabear114 22 years, 3 months ago
Hi, I have been studying C+ for a little while and have read about 200 pages of Tricks of the Windows Game Programming Gurus and stuff, but I am interested in making a simple game that I do not believe would need DirectX. The type of game I am interested in is a simple RPGme such as Castle of the Winds (if you do not know what I am talking about, a simple search should return free download etc..) where I all really need is small tile graphics and some collision detection. The player is a tile and moves along on other tiles and each time the player tries to move onto a tile it determines what it is and does the appropriate action (wall = no move, monster = calculate damage dealt/recieved, etc). I do not think DirectX would really be necessary to just move some small tile graphics around on a screen, since the rest of it will probably be text, so does anyone know where I could get information on how to do it another way or maybe a small example script on moving pictures and basic collision detection for tiles? Or if DirectX is still the best way to do it that is fine too. I am just looking for some advice, I understand the whole "baby steps" idea and am not trying to do anything too crazy.. I could have already made the game in VB probably :\ Thanks for any help in advance
I am not familiar with the game you reference nor did i search for it.

Personally I would suggest doing it with dirextX. Depending on the version (I still use directX7 interfaces) it shouldn''t be too difficult (especially if you use DDraw), and it should in fact make things easier for you. "TWGPG" should give you all the info you need on how to move images around the screen. Just copy the t3dlib1.h and t3dlib1.cpp into your project {don''t forget to set up your compiler correctly; paths, LIB}.

The Two-And-More big leaps in this project are:
Deciding on whether or not you will write your own World Map Editor (which can be done in VB, MFC, BUILDER...). Without it you will have to manually load your world array with stuff like
worldmap[MAX_X_SIZE][MAX_Y_SIZE]{1,1,1,1,1,1,1,1,0,0,0,0,3,2,1....}
Which can make it difficult keep track of your tiles and such.

You need to decide whether or not you will write a tile class that will hold atrributes of the tile eg. walkablity,speed,animation state etc.... If going for true simplicty you could just use another layer (3 dimensional array) to check for walk ability.

If you don''t use a script you will have to hardcode all of your text.

There''s obviously many other elements but you get the idea.
Try checking out Prima Tech''s "Programming Role Playing Games with DirectX" for more info.

If Setting up directx is not your specialty you can still do this with windows GDI, OpenGL, Allegro...


~Zen
Advertisement
I have a function in my java program that reads a text file and returns a two dimentional array, you might be able to use.

      public static int [][] readFile(String filename) throws java.io.IOException    {        BufferedReader br = null;        int [][] result = new int[100][100];        try  {            br = new BufferedReader(new FileReader(filename));            for (int i = 0; i < 100; i++)            {                String line = br.readLine();                for (int j = 0; j < 100; j++)                {                    result[i][j] = line.charAt(j) - '0';                }            }            return result;        }        catch (java.io.IOException e) {            System.out.println("error");        }        finally        {            if (br != null)                try { br.close(); }                catch (java.io.IOException e) {}        }        return result;    }   

I got this from c_wraith and it's been a great part of my game.
the error handleing is horrible but it works. You should be able to adapt this to C++, if not I can help you with that.



[edited by - ElCrazon on August 14, 2002 4:19:05 PM]

This topic is closed to new replies.

Advertisement