9/20

An article about the Nintendo/Palworld lawsuit claims that Nintendo will likely win


Start off the day with the warm-up

Quick Question for the class...

Who is your favorite SMB Character and why? Be prepared to share

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

Open GDevelop

Click Build

Click Create Project

Select Desktop Full HD

Save on your computer

Give it a name

Click Create Project

In the objects panel on the right, click Add New Object

The object we are going to add is a Sprite

Name the Sprite Hero

Click Add Animation

Click Create with Piskel

Create a jack - o - lantern in piskel

Click Save

This screen is where you are going to add all your different animations for the hero

Jump, climb, fall, etc

Name Animation #0 Pumpkin

Click Behaviors

Behaviors makes your Sprite "do stuff"

Click Behaviors

Click Add Behavior

Choose Platformer Character

This is where you are giving all the controlls to your character (movement, jump, climb)

We are going to use default controls for this project but feel free to play around with them.

Click Apply

We can now add our character into the game 

Drag your Hero into the play area

Click Add new object (we are going to greate a platform)

Select Sprite

Name the object Platform

Click Add Animation

Just like you did with the Hero, select create with Piskel

Create a platform looking sprite and save it

Next we are going to add the platform behavior and click apply

Add your platform to your game below the hero then preview the game

Use the arrow keys to move and spacebar to jump

Copy and paste (ctl C & ctl V) a few platforms so you can move around the game

We will create and add a coin to the game

Add new object

Select Sprite

Name it Coin

Select Add Animation

Click Create in Piskel

Make a simple coin in piskel

Save it

**We do not want a behavior on this sprite**

Add some coins in your game

Test it out

Nothing happens when you hit the coins because we have not told the game to do anything

Just like with SMBX, GDevelop uses Events to make things happen

If you look at the events tab, you will see At the beginning of the scene

This means exactly what it says so the moment you start the game (scene), whatever you add to this event will happen

We want to add a new event

Click Add a new event

This will create a event that is seperate from the At the Beginning of the scene

What we are working on are conditional statements


A conditional statement, also known as an if-then statement, is a statement that expresses a relationship between two ideas, where one idea depends on the other. For example, "If it rains, the picnic will be canceled" is a conditional statement. 

What we are going to do is basically say that if the the player touches the coin then the coin will disappear

If you used code.org, you will be familiar with this

player = hero


Click on the Add Condition that you just created

We are going to select the Object that we want the event to use

In this case, click on Hero

So now we have our condition (The IF)

If hero is in collision with coin

Next we want the action (THEN)

Click Add Action

The object we are going to use is the coin

The action we are going to use is Delete this object

So we have now created our first event

If Hero is in collision with coin then Delete Coin

Test the game and save

Next let's add another action to the hero collides with coin condition so that a sound plays.

In the same event, click Add Action

Search for Play a sound

Click Create with Jfxr

Click on Pickup/coin

Play around with the settings and when you are happy with it, click save

Click Okay

Now you should have two actions that happen after the condition is met

Save and test

Now let's make a bad guy

Add new object

Sprite

Name it Badguy

Select Add an animation

Create in Piskel

Save it and add the bad guy to your game

Now it's time to create an event so the bad guy can do something

Switch to your events tab andf create a new event

This event is going to be similar to the coin collision

This time we want the game to reset if the Hero collides with the bad guy

Create a new event

Object Hero 

The action we want is to change the scene which is basically resetting the game (we will do more with the later)

Save and test

Your game should reset when you touch the Badguy


Last this you should do is click on your background color and change it to something you like 

Let's animate the Hero

Double click on hero to upen Edit Hero

Select Edit in Piskel

Move the hero to the bottom of the workspace

Duplicate the frame and move the Hero up one pixel

Duplicate this frame and move the Hero up one pixel

Continue the process until you reach the top then do the same thing until the hero is back at the bottom

Click Save

Make sure loop is selected 

Click apply 

Save and test

Your Hero should bounce

Let's to the same for the Badguy but instead of making it bounce, lets just have the bottom move.