I enhanced this code a bit:
JaRE.zip - 12.6 MbI tried to translate the german comments.
SchranzOr:
How do you translate: Super-Sprungkraft, indem er schnell hoch"fliegt"?
If you know more efficient ways for this program - please post them.
Don´t forget to comment them, since this is a tutorial thread.
Since SchranzOr already coded the hard stuff (physics), it should
be fairly easy to add other things like scrolling, adventure-elements
(like in "Cave Story"), NPCs etc.
The current code should be easy to analyze but here are some
additional explanations:
-
Click on the "?"-icon (in title screen) for basic information
-
If you want to create own levels, press [^] (under ESC) in game mode,
draw your level and don´t forget to press [´s´] to save it before
leaving this mode! You can navigate through the levels with [ARROW LEFT]
and [ARROW RIGHT]. They are saved with their index + ".lvl" (in the "Levels"
directory). When the program doesn´t find a file with the next higher index
after finishing a level, it executes "fnVictory()".
-
You can access the "settings" mode with [TAB] in the editor, but
the only functional icon is "Exit" yet.
Set Rednag:
Hold down [Strg], left click at starting point, move mouse to destination
point and release the key.
Set Ghostfloater:
Hold down [Strg], left click, move mouse to starting
point and release the key.
[Strg] + [´x´]: erases all creatures on map
NOTE: you can place up to ten creatures per level
-
How to implement a new Creature:
Copy the graphics into the "GFX" directory and load them in "subINI:".
Create three new SUBs (in "Creatures.gbas"):
The first one is executed when setting the creature in editor mode.
The second one displays the creature in editor mode.
The third SUB computes the creature in the actual game.
To make it easier, I created three templates for this.
Name convention:
"subEditC" + n(next higher index), "subDisplayC" + n and "subC" + n.
Increase cMAX_C_IDX by 1 (jump to "_CONSTANTs:")
This is important, because the code will ignore your code otherwise.
- - -
I wanted to add more features, but don´t had the time.
I know that the "game" is crappy in it´s current state, so don´t be
shy with criticism (and optimization proposals).