PHONES AWAY!!! It's too much already
Starting next week, we will be testing an A/B Schedule for English.
A Week
Mon - Third
Tues - None
Wed - Second
Thur - First
Fri - None
B Week
Mon - Third
Tues - None
Wed - First
Thur - Second
Fri - Third
Start off the day with the warm-up
Write a story based on the two words written on the dry erase board on the right side of the classroom.
Half page
Three Points
What are you learning?
Gdevelop
Scene Variable vs global variable
Coin counting
Life system
Why is it important?
This is what we use for 2D games
How do you show that you understand? What is the assignment?
Follow the directions and complete the lesson with me.
Once you are finished, add all the elements we went over today in your CARTKour Game
We will be creating a crouch
Open your Hero
add a new animation
call it crouch
create a pumpkin pie width of your Hero
Edit the collision Mask on the Pie
Add a new event
Condition: Key Pressed
Key: z
Action: Change Animation
Create new Object
Name it Wall
Create is Piskel
Size 64x64
Create a wall/stone/brick/whatever
Name animation 0 WallSmall
Create a second Animation and name it WallTall
Edit WallTall in Piskel
Change your WallTall Sprite to 64pm wide x 256 tall
Copy your Wall Small and paste it in your WallTall Animation then move it to the bottom
Duplicate the frame and create a new layer
paste another instance of your WallSmall in the new layer and stack it on the first layer
Repeat this process until you have enough layers to cover the entire wall
Do not loop the animation because you only want it to happen once.
Add the platform behavior
Add your wall to the game
We want the wall to build up when we collide with it
Create a new event
Condition
Hero
Collision
Wall
Action
Change animation
WallTall
When you preview the game, the wall is not growing taller
Open up your wall object and click Edit Points
When you review the different Animations numbers and Frames, you can see that the origins are both at the top left hand corner and the center points are different
We also have Share same points for all animations selected
What I want to do is change the Origin to the bottom left corner and center from the bottom so that the animation goes up
We DO NOT want to share the same points for all animations and sprites because the bottom corner of wall small is not the same as the bottom corner of WallTall
Test it
The animation is still failing to do what we want
The reason for this is because we have different points in our different frames
Set all the points in every tall frame to the same spot
Test it
The animation works but we can still walk through part of the wall
The reason for this is because we have the same collision mask on all the objects in the frame
The collision mask is the area that can be collided with, it is also the area that you can stand on (remember we make this a platform object)
Open your Wall Object and click Edit Collision Mask
We need to select Use custom collision mask so that we can set the mask around each frame
When you compare Animation 0 to animation 1, you can see that the collision mask is only covering the top so there is no collision on the rest of the object.
For this reason, we need to turn off Share same collision masks for all animations because each frame needs a collision mask around the object
Go through each animation and frame
Move the collision mask to that it covers the entire wall
Test and save
Let's go over delays aka Wait
Create a new object
make a skull and crossbones
Create a second animation
reuse the skull and bones from the first animation
Duplicate the frame and erase a little bit
Duplicate the frame and erase a little bit more
Continue this until the art is gone
Create a new event
Condition
Hero
Collision
Skull
Action
Change animation to the second skull and bones animation
Additional action
Wait
2 second
Move the wait before the change animation
test save
Now let's add pathfinding
Create a new sprite
Name it Banshee
64x64
Animate it in Piskel
Loop the animation and place it in your game
Add behavior
Pathfinding
Open up your platform and add the Obstacle for pathfinding behavior
NOT PATHFINDING!
Create a new event
Condition
Hero
Distance between two objects
Banshee
600
Action
banshee
move to a position
Hero.X()
Hero.Y()
Start Menu
Create a new scene and name it Start Menu
Name your first level
Add a new object
Text Object
Add something to the effect of Press Any Key to start or something similar
Bring it into your level
Open extensions
Add the Flash Object Extension
Install in project
Open up your text opject
Add the flash behavior
Select Flash visibility
Open events
Add new event
Condition always
Blink
Text object
Test it out
Now we are going to add out hero, blade and arrows into this scene by changing it from a scene object to as global object
Once you do this, the hero will be available in every scene
Bring them all into the scene
Open your Start events
Link the enemies external event
Select enemies
Test
We have problems
Remember, we gave the hero the platform character behavior so physics are making it fall.
We also made the walking variable a scene variable, not a global variable to it only works in the first level.
Add an invisible platform (like we did with the Killzone) with the platform behavior or create a new platforms and hide it in the events (like we did with the arrows)
What we want to happen is that the Hero falls and lands on top of the text
Fix the walking variable issue by changing it to a global variable (just like we did with the coins).
Delete the Scene walking variable
Add the Global walking Variable
Hide the arrows in the Events
Now add a new event
Condition
Any key Pressed
Action
Change scene Level 1
Test and save
Open your first level events
Add a new event is health
Condition: Object variable value
Object: Hero
Variable: health
Sign of the test: <(less than)
Value to compare: 0
Action: Change the scene to Start
Remember that all the events run from top to bottom?
The same thing happens with the scenes so you must move the start scene above level 1