[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
EDP-Pascal
This is basically what my formula for making a game is:
Let me show you how we would go about making a "Game Engine". What I mean by a game engine is the internal working of the game. This is how we do it:
I presented code for Arkanoid as a supplement to one of my previous articles. But over there I only presented the basic code for the game. Here is a more complete version that includes more advanced concepts such as fonts and mouse use which were discussed previously. Here you can find a word search maker program made in pascal, using many of the things which I mentioned above. It is a good example of what I mean when I say that you can implement EDP in Pascal.
Thanks for reading and enjoy your game programming.
Relman
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
EDP-Pascal
This is basically what my formula for making a game is:
- Have an Idea (duh!)
- Work out how you want to implement it
- Create your "Game Engine" (See below)
- Create the graphics to fit into your games
- Gogogogogogogogo
- Woops I found a bug...
- Finally, it is complete.
Let me show you how we would go about making a "Game Engine". What I mean by a game engine is the internal working of the game. This is how we do it:
- We define our types
- We make procedures that can deal with those types
- We allow those types to deal with each other (The snake collides with the wall)
- We allow the user to deal with those types (Input)
Notes about specific game types:
I'd suggest that you read denthors pascal graphics tutorials in order that you can make nice games with good graphics. Things like page flipping and so on are important in order to get smooth graphics in your games.Point and click, Adventure games:
The trick to making adventure games (with regard to programming) is that every screen is an entity unto itself. Therefore, create a type called "Screen" and add things like- "name" - The name of the file containing the graphical image for the file.
- "hotspots" - An array of locations that when clicked on will call a procedure that knows how to deal with that specific location in that area. so that if the mouse was clicked, the program will call a procedure that will, for example, pick up the thing clicked on.
- "Exit points" - Similar to "hotspots", but this contains what will happen if a person clicks on a door - what screen will now appear...
Action Games
These games come in many forms, but they generally follow the Arkanoid and snake approach. Have a delay and update the playing screen. If the user pressed something, like and arrow key, change the direction of the in-game object. Racing games and flight sims fall under this category (Although the graphics can be complicated...).Role playing game
This kind of game usually has a "MDI" (Multiple Document Interface). You will have the screen on the side showing the characters current stats and a screen showing the map and a screen showing what is directly in front of the player. These kind of games are usually tile based (the player might not see this, but in memory they save the map as an array of segments with data for each tile. (At least for most games)). What you could do is create an array of Char the size of the map. Then make yourself a "Key" that says what each letter stands for and then you can create your maps in a text file and draw your map based on it (Each character can represent a few features stuck together.). Or, you can make your array based on a more complicated type (which contains the full information of each tile), but that means that you are going to have to write a program to create your own maps. Then you should make your database of monsters and work out how you are going to implement the usual "RPG" style fighting. Is your RPG going to be a first person shooter or Dungeon hack or is it going to be something like Mordor?To conclude
All the concepts I have mentioned above can be and are applied to games written in all languages. In "Visual languages" like Visual Basic or Delphi, we don't need to add our own repeat loop, just use a timer and overload the on paint command. And just to remain true to my header I must answer the question: "Who needs Delphi?". What is Delphi? it is "Pascal for Windows". Windows is an event driven operating system. Events caused by mouse clicks - not only by keyboard (well, maybe also by timers, but that is beyond the scope of this article.). Based on what I have said, we can create a more true to DOS version of event driven programming - just code in that main loop and you are there!!!I presented code for Arkanoid as a supplement to one of my previous articles. But over there I only presented the basic code for the game. Here is a more complete version that includes more advanced concepts such as fonts and mouse use which were discussed previously. Here you can find a word search maker program made in pascal, using many of the things which I mentioned above. It is a good example of what I mean when I say that you can implement EDP in Pascal.
Thanks for reading and enjoy your game programming.
Relman
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
