Making It Work |
|
||
|
Getting Started: Plateau3 is a rework of Plateau2. The code that allowed cruising the plateau world, and the stuff for loading and manipulating objects has been deleted. Only the basic helper routines, the routines for loading an existing landscape, and those that load a saved set of objects have been retained. What has been added is the logic to make the level work. You can now pick up and use keys, traverse bridges and interact with all of the other objects to complete the level. Plateau 3 is a working game and only needs some dressing up to be complete.
Download Plat3.zip (600 Kb)
Unzip this file into its own folder and have a look at the ReadMe.txt file for an explanation of what is in the included files. 1. Run Plateau3 from Dark EDIT. Play and beat the level. By doing this you get to see the code in action. This will make it much easier to understand. 2. All the new stuff is in the Plateau3.dba file. The included files contain routines that were developed in Plateau2. Some of these were moved out of the main file, but they function exactly as they did before. In short, understand Plateau3.dba and you will understand how the game was made to work using Dark BASIC. 3. Read the main code in Plateau3. See how it first initializes the world and then enters a main program loop that makes the game work? You should understand much of the main loop right away. Again, keypresses and the mouse make things happen. Moving the mouse now moves an invisible Player piece around the landscape, and the camera tracks along behind. As the Player hits objects, the program reacts in various ways.
Near the bottom of the loop a call to the
DoToDoList function takes care of the delayed animation of objects like rising gates and sinking barriers. There is a fair amount going on here, but understand the main loop and the rest
will be pretty easy.
4. Now start puzzling out the functions. The important ones are: LoadOperationalObjectsAndData( ) - quite a name, huh? This loads invisible objects to assist in the functioning of gates, stairs and slides. PickUpAKey( ) - if the player is close enough. UseAKey( ) - if it's the right one. HandleCollision( ) - does various things depending on what the Player bumps into as he wanders about. DoToDoList( ) - handles animations. The 'float to a new location' chunk is especially cool. See if you can figure out on paper how this little puppy works.
HandleFlight( )
- this is where the level ends
--- when the user flies into a picture of me that is now part of the landscape. Think you understand it? Ok, lets see if you can: 1. Make a random red apple fall very slowly from any apple tree the player crashes into. Use 'Make Object Sphere' to create the apples. 2. Place a blue cube behind the starting point. If the Player hits this, open all the gates. 3. Place a yellow cone in front of the starting point. If the Player hits this, he should do a parabolic flight to land near the red key. (This will be a little tricky, I think.) Note: You can de-comment the line that reads ShowStatus( ) at or near line 258 to help with figuring out object positions.
|
|||
|
|
![]() |
||
|
|
|||
|
|
|||