Swing Copters...From The Ground Up

3

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

16,634 visits, 37,899 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 11 Aug, 2017. Last updated 19 Feb, 2019

Create an event with the 3 conditions:

-System: Every X seconds, where seconds is 0.07

-obj_ScoreBoard Compare Y, where Y equals 365

-System: Compare variable, where ScoreCounter is not equal to Score

The actions for this event:

-System: Add to, where variable is Score and value is 1

-spf_ScoreBoard set text to variable ScoreCounter

-play coin sound

Create an event for when the user touches obj_Playbutton.

The actions for this event:

-play coin sound

-set all layers invisible (HUD, Foreground, Player, Enemies, Midground, and Background)

-wait 0.3 seconds

-System: Restart the layout

Create an event for when the user touches obj_BackButton.

The actions for this event:

-play coin sound

-set all layers invisible (HUD, Foreground, Player, Enemies, Midground, and Background)

-wait 0.3 seconds

-System: Go to layout Intro

The Functions Event sheet

The function On "PlayerHit" will be called when obj_Propeller or obj_Player collides with obj_Grider or obj_Hammer, or when obj_Propeller hits the left or right side of the screen.

The actions for the function:

-System: Set group active, deactivate the Player Controls group and the Vertical Down Scrolling group

-stop the fan sound

-play the crash and fun sound

-destroy obj_Propeller

-obj_Propeller spawns obj_LeftPropeller on the Enemies layer

-obj_LeftPropeller, set the angle of motion at a random number from 0 to 180

-obj_Propeller spawns obj_RightPropeller on the Enemies layer

-obj_RightPropeller, set the angle of motion to a random number from 0 to 180

-obj_Clouds, set angle of motion to 270 degrees

-obj_Clouds, set Bullet speed to 1000

-obj_Pipes, set angle of motion to 270 degrees

-obj_Pipes, set Bullet speed to 1000

-obj_Pipes, set Bullet behavior enabled

-obj_Ground, set angle of motion to 270 degrees

-obj_Ground, set Bullet speed to 1000

-obj_Ground, set Bullet behavior enabled

-obj_Girder, set angel of motion to 270 degrees

-obj_Girder, set Bullet speed to 1000

-obj_Hammer, set angel of motion to 270 degrees

-obj_Hammer, set Bullet speed to 1000

We will now rotate the player in the direction it was facing.

Create the first sub-event within the Function On "PlayerHit" which checks if obj_Player is facing to the right (not mirrored) and with the action obj_Player set rotation speed to 360 degrees.

Create the second sub-event which checks if obj_Player is facing to the left (mirrored) and with the action obj_Player set rotation speed to -360 degrees.

[page="

Clean Up"]

Clean Up

When I finish a project, I always check the events and actions one by one. I test the project over and over to get rid of any bugs, or anything that is redundant.

Here is an example, the Vertical Down Scrolling group.

The objects have the same conditions and actions. If we combine the obj_Ground actions with the obj_Pipes actions, we can delete the obj_Ground event. That's one event less, bringing our event count to 60.

.ZIP

swing-copters-assets.zip

Download now 195.54 KB
.CAPX

swing-copters.capx

Download now 328.31 KB
  • 2 Comments

  • Order by
Want to leave a comment? Login or Register an account!
  • dazedangels We us this counter for the Medal screen. If your score is 10 and you die then on the Medal screen. Start at 0 and increase by 1 every 0.07 seconds until 10 is reached.

    youtube.com/watch

    Check this vid at 0:36.

    Hope this helps.

  • Why are we creating an event in "Game Over" to add 1 to ScoreCounter every 0.07 if ScoreCounter isn't equal to Score? What is ScoreCounter doing, if the game is over?

    "-System: Every X seconds, where seconds is 0.07"

    Thank you.