Platform Engine using Loops Part II
Author: | Arneckian
|
Submitted: | 11th May, 2006
|
Views: | 5777
| Rated: |
|
|
Please read http://www2.create-games.com/article.asp?id=1671 first.
If you have all the events in groups, then this will be easy.
Springs→
Creating springs is easy.
Firstly, create a spring-like object and call it spring. Secondly, create a group in the event editor called spring.
Third, add these events:
+Alterable Value B (Player) is pressed
+(Bottom Detector) is overlapping (Spring)
-Set Alterable Value B (Player) to -5
+Only one action when event loops
+(Left Detector) is overlapping (Spring)
-Set Alterable Value A (Player) to 0
+Only one action when event loops
+(Right Detector) is overlapping (Spring)
-Set Alterable Value A (Player) to 0
+(Bottom Detector) is overlapping (Spring)
+Repeat while Shift is pressed
-Set Alterable Value B (Player) to -15
Simple enough, When you are just standing on a spring you bounce a little. When you hold shift you jump a lot higher.
Think you're done? Think again. If you run into the spring. You go through it. This is because, in the loops group, notice that it has:
+On loop Horizontal
+Alterable Value A (Player) > 0
+(Right Detector) is overlapping obstacle (Negate)
-Set X position (Player) to X position (Player) + 1
Add:
+(Right Detector) is overlapping (Spring) (Negate)
Do this for all the loops.
Done!
Wasnt that easy.
Water→
Water is easy as.
Create an active object with that blue blue color. (R,G,B = 0,0,255) Set the semi-transparency to a fairly high number.
In a 'Misc' group or 'Other' or whatever you use for misc events, add:
+Always
-Bring to front (Water)
+(Water) is overlapping (Player)
-Activate group Water
+(Water) is overlapping (Player) (Nagate)
-Deactivate group Water
Then, create a group called water, turn off Activate when frame starts and add:
+Every 00.10 sec
+Alterable Vaue B (Player) is < -5
-Sub 1 from Alterable Vaue B
Very simple and easy to understand.
Double Jump→
For double jump, we are going to use a flag.
On the normal jumping actions, add:
-Set flag 1 (Player) to on
Then add these events:
+Upon pressing Shift
+Flag 1 (Player) is on
+Alterable Value B (Player) < 11
-Sub 7 from Alterable Value B (Player)
-Set flag 1 (Player) off
This tests to see if the player is pressing shift then makes sure that flag 1 is on and that the player is'nt falling too fast. Then it jumps again and sets flag 1 to off so you cant jump again.
On this event:
+Alterable Value B (Player) > 0
+(Bottom Detector) is overlapping an object
-Set Alterable Value B (Player) to 0
Add:
-Set flag 1 (Player) off
This makes sure that when you jump normally, you dont double jump accidently.
Terminal Height→
If the player falls from a height and Alterable Value B gets greater than 20, then you die.
Events:
+Alterable Value B (Player) >= 20
+(Bottom Detector) is overlapping background
-Destroy (Player)
If Alterable Value B is greater or equal than 20 and you touch the ground and flag 2 is on, then you die.
The End
|
|
|