SpikeBall Events
Create a new Event Sheet called SpikeBall
Create a new Event Sheet called SpikeBall
Add the SpikedBall sprite to your Temp Layout and give it the Orbit and Pin behaviours.
Add the SpikedBall sprite to your Temp Layout and give it the Orbit and Pin behaviours.
Reset all of the Orbit properties as we will assign them dynamically in the event sheet.
Reset all of the Orbit properties as we will assign them dynamically in the event sheet.
Create a new Group for the Rotating Spiked Ball
Create a new Group for the Rotating Spiked Ball
Right-click on the group name and add a new local variable to keep track of the number of rotations.
Right-click on the group name and add a new local variable to keep track of the number of rotations.
Add a new event to the group which will run when the ChainBaseRotate pin is created.
Add a new event to the group which will run when the ChainBaseRotate pin is created.
Press S on the keyboard to add a NEW SUBEVENT which will repeat 5 times (the value of the length instance variable.)
Press S on the keyboard to add a NEW SUBEVENT which will repeat 5 times (the value of the length instance variable.)
These are the steps to create the chain links. The code is explained line by line afterwards.
These are the steps to create the chain links. The code is explained line by line afterwards.
The loop runs 5 times because that is the value stored in the Length instance variable of the ChainPin.
The loop runs 5 times because that is the value stored in the Length instance variable of the ChainPin.
Each time the loop runs a new ChainPin is spawned.
Each time the loop runs a new ChainPin is spawned.
The Orbit of the pin is then set to 16 pixels away from the previous pin
The Orbit of the pin is then set to 16 pixels away from the previous pin
The Orbiting speed is set to the value of the RotationSpeed variable
The Orbiting speed is set to the value of the RotationSpeed variable
The starting angle (which is the starting position) is set to the value stored in the InitialAngle variable
The starting angle (which is the starting position) is set to the value stored in the InitialAngle variable
We store the current loop count in our local variable for use later.
We store the current loop count in our local variable for use later.
Press B on the keyboard to add a NEW BLANK EVENT to the group.
Press B on the keyboard to add a NEW BLANK EVENT to the group.
The actions for the spiked ball are shown below .
The actions for the spiked ball are shown below .
The spiked ball is created the same way as the chain pins except that there is ONLY ONE of them.
The spiked ball is created the same way as the chain pins except that there is ONLY ONE of them.