Game Programming Tutorial RPG Chapter 1 Part 2
by Charles on Sep.25, 2009, under Game Programming
Create an original RPG game: Chapter 1, part 2.
You should start here to have a better idea where this is going!
Game programming with dynamic objects.
Don’t worry if you don’t know what objects are just yet. It will become very clear as you read on.
Before doing anything you will need to create a room. Right-click on Rooms and create one. Don’t do anything with it yet.

Then you create the objects (right click on Objects folder, just like sprites or rooms) Double-click on the new object in the panel, name it,
and then you associate the sprite.
For dynamic objects, (objects that don’t always look the same) I often prefer to not associate sprites, but use the draw event to call a piece of code.
The code will dispay the sprite according to variables that change as the player interacts with the game. This gives many more options than by using the limited point and click features.

-
Create the draw event (pick it from the options that appear by clicking on Add Event).
-
Select the Control Tab.
-
Click and drag “Execute Code” from the Control Tab to the list of actions.
Several objects are used at this point.
-
The character object (main_ch) which can move around and trigger a pop up when it hits something.
-
The north, east, south, and west doors. Only north and east are in that room, but the others are available for later rooms.
-
The horizontal and vertical wall pieces.
-
A table object.
-
Square objects for future inventory slots.
-
Topbar, and inventory objects.
-
A bag and character inventory objects.
Objects can be placed in the world view, or Rooms to appear in the game. Sometimes you won’t place them there at first but they will be created later by the game, according to situations that occur. They can react to different situations (be created, be destroyed, change appearance, move…). Those situations result from the programming and can be much more diverse by programming code than they can be with the point and click options.
Post Footer automatically generated by Add Post Footer Plugin for wordpress.
