Swing Copters...From The Ground Up

Index

Attached Files

The following files have been attached to this tutorial:

.zip

swing-copters-assets.zip

Download now 195.54 KB
.capx

swing-copters.capx

Download now 328.31 KB

Stats

4,633 visits, 11,078 views

Translations

This tutorial hasn't been translated.

Tools

We will now do the opposite. To do this, we will use the Else condition. Right click on the event obj_Player is not mirrored and add an Else condition, or press X on the keyboard.

Select all the actions from the event obj_Player is not mirrored by selecting the first action, holding down the Shift key, and selecting the last action. Press Ctrl C to copy. Select the Else condition and then Ctrl V to paste the actions.

Because Else is actually Is Mirrored, there are two actions we need to change.

-obj_Player is not mirrored (facing to the right)

-obj_Propeller's angle of motion set to 0

We do not want the events in this group to be executed when the game starts. We will have to set this group to deactivated and set it to activated later on. Go back to On start of layout and after Reset global variables, add the action System: Set group active. Type "Player Contols" in the Group name field and select Deactivated for the State.

Group: Player Rotation

Depending on which direction obj_Player is facing (condition 1), we want obj_Propeller to rotate towards a given angle by 2 degrees (action). We only want the rotation to start when obj_Clouds starts moving downwards (condition 2). You could use another object, but since the clouds are on the Background layer, I chose to use this object. Thus, for this to work, we will need 2 conditions in 1 event block.

So, how do we check if obj_Clouds is moving? If you take a look at all the available Bullet conditions for obj_Clouds, there are only 2 to choose from.

Compare speed would not be the right choice for this to work because this just compares the Bullet speed value and not if obj_Clouds is actually moving. Compare distance travelled would work just fine in this case. If an object is moving then there is a distance travelled.

Create an event with these 2 conditions with the action which rotates obj_Propeller to an angle of 12 by 2 degrees. When done, copy and paste this event. Change the condition and action for the other direction. On the next page, you will see how the events are built up. Give it a try first.

  • 0 Comments

  • Order by
Want to leave a comment? Login or Register an account!