9/25

Start off the day with the warm-up

Let's talk about pets

Do you have one? Did you ever want one? How did you end up with your pet? What is their name(s)? Do you have any interesting stories about your pet? If you never wanted a pet, why not? If you have nothing to say, make something up.


We have two cats, one is named Maximo and one is named Mooshie. Maximo was an orphan kitten in Gilroy, CA, the mother was hit by a car so this cat was wandering around my Auntie's House. She bottle fed him until he could eat regular fgood and then she looked for a home for the guy. We told him that he could live with us and he has been here ever since.

The other cat, Mooshie has a bit of a shadier story if I am being truthful. Mooshie was living in downtown Fresno in some bushes. There are lots of cats living down there because there is this very fertile mother cat that keeps having kittens. My wife's boss is a cat rescue lady and has been trying to cath the momma cat for years but she is very slick. In the meantime, she catches the kittens, takes them to the vet and gets them fixed and brings them back then lets them go, it's called T-N-R, trap neuter return. 

So my wife calls me and says she is goingto be bringing another cat home. I tell her that is not a good idea because Maximo is pretty old and probably doesn't need a kitten messing with him. Apparently my sage advice was not convincing because she returned home that day with scratches on her arms but no cat.

I told her that it was a sign and to leave the cat alone but she was determined to take this cat from it's home.

From what I understand, the next day she pretended she was just walking by this cat but she had a large beach towel that she threw on top of this poor kitten and pounced on it like a lion on a gazelle then stuffed it in a cat carrier and brought it some.

Now we have two cats but don't get me wrong, I like Mooshie, he is part of the family but I wasn't for bringing him home in the beginning.

half page

3 points

What are you learning?

GDevelop

Why is it important?

Now that we have created a came with SMBX and learned about level, storyboarding, NPCs and design, it's time to go to the next step... adding physics, conditions, actions, scenes, If/Then statements and more!

GDevelop uses the Box2D Physics Engine 


How do you show that you understand? What is the assignment?

Today we are going to start playing around with Gdevelop. 


Items we will discuss today

Jumpthru platform

Center Cameras with NO CONDITION so it always runs

Ladders

Death/Respawn


Changing the animation when it touches another object

Our events are getting pretty big so it's time to organize a little bit before we continue adding more

Add three event groups

Name the groups Player, Camera and Collision and place the events in the appropriate group

Open up your Hero sprite

Edit in Piskel

Copy your first frame

Save

Add new Animation

Name it HeroRight

Edit in piskel

paste the hero

Modify the frame so that your pumpkin is facing right

We are now going to create sub events

Add new event

Now let's create a jumping animation for the Hero 

Open up and add animation

Name it Herojump

Copy your original Hero and paste it in the first frame of Herojump

Create an animation that will play when the Hero jumps

Go back to events

Create a subevent in your Hero Is Moving Event

Condition will be Hero is Jumping

Action will be Change the animation of Hero set to Hero Jump

Test and Save

when the hero moves right, and it stops moving, the sprite is still facing right. We want it to return to the idle pumpkin

To do this, we are going to use an inverted condition. This sounds exciting but alas, it is actually rather dull.

Create a new event

Select the hero and is Moving but this time click on the Invert Condition

All we are doing is saying When the playing isn't moving

We are going to change the animation to Pumpkin

Test and save

When you go left, the hero still faced right

Create a new event to fix this

THIS IS A NEW ONE!

Add a new event

Add condition

The condition is key pressed and the key is the right key

The action we are going to use is Flip Horizontally and select NO for activate flipping

The reason we are doing this is because the hero already faces right when we move but when the condition left key is pressed, it permanently flips the sprite so we have to flip it back when we hit the right key

Now let's to the same for the left key but this time we will activate the flipping

We will add a sound to the jump by adding another event

So when the Hero is Jumping

Now add a secondary condition called Trigger Once

Action is play a sound

Create a sound

Test and Save

Try to create a climbimg animation on your own

Add an event

The if/then

If the hero is on the ladder then change the animation to the climbing animation

We are going to mess with LERPs

Lerp - Linear Interpolation, is a mathematical function that returns a value between two others at a point on a linear scale. 

Basically it eases the transition between two values over time.

So the math here is lerp (X,Y,Z)

X = Start Value

Y = End Value

Z =  Value to interpolate Start and End (tfor our purposes, the speed that the camera follows


Now we are going to change the focus of the camera off the Hero and on the X position

Delete the action for your camera event so you have an empty event

Create a new action 

Center Camera X position

Value is:

lerp(CameraX(), Hero.X(), 0.25)

So our start value is the Camera's X Position - CameraX()

Our end value is the Hero's X position - Hero.X()

The interpolation (speed) is 0.25

Test this out and change the last value until you have the LERP that you like.

Do the same for the camera Y position

Time for Parallax

Add a new object

Sprite

Name Clouds

Add animation

Piskel

Size 256 x 256

Make a cloud

New we are going to add a three layers

Your base layer is where all the game play is happening

name the three new layers Front, Middle, Back

Reorder your layer if you wish

With your base layer selected, drop in a cloud and move it to the middle layer

You should now be able to see your platforms in front of the cloud

Add another and rotate it

Make a moon

Add a new object

Sprite

Name Moon

Add animation

Piskel

Size 256 x 256

Make a Moon

Add it in the scene and place it on the back layer so that it is behind the cloud

Now we will give that Parallax look

We are going to change the camera follow speed at different layers

Go to your events

Add a new event

Place it under Camera

We want it to be all the time so condition is blank

The action is going to be Camera center X position

So the camera is going to go at the speed of the hero x .8

Do the same thing for the Middle Layer

Time to make an external event

Add a new object

Sprite

Name Blade

Add animation

Piskel;