Part 2 of 3 - Wake Up And Code!

advertisement

Right-click to

Rename each sprite

Name them:

• Player

• Monster

• Bullet

• Explosion

Change Blend Mode to Additive

Zoom Out:

• Ctrl + Scroll

Move the bullet and explosion outside the

Layout

Select Player

Click

Click Add New

(plus sign)

Scroll

Up

Or

Down

Select

“8 Direction” then

Click Add

Click

Again

Click Add New

(plus sign) again

Select

“Scroll To” then

Click Add

Click Add New

(plus sign) again

Select

“Bound To layout” then

Click Add

Close popup

Select Bullet

Click

Click Add New

(plus sign)

Select

“Bullet” then

Click Add

Click Add New

(plus sign) again

Select

“Destroy outside layout” then

Click Add

Close popup

Select

Explosion

Click

Click Add New

(plus sign)

Select

“Fade” then

Click Add

Close popup

Update Bullet

Speed = 600

Update Explosion

Fade out time = 0.5

Select

Monster

Click

Click Add New

(plus sign)

Select

“Bullet” then

Click Add

Close popup

Update Monster’s

Bullet Behavior

Speed = 80

Select Monster

Ctrl-Click and Drag to create more!

Add events to the

Event Sheet

Object

Condition

Event

An “Event” happens when a Condition is True for an Object

Right-Click, then

Add

Event

Select

“System” then

Next!

Select

“Every tick” then

Done!

Click to

Add Action

Select

“Player” then

Next!

Select

“Set angle toward position” then

Next!

Enter Parameters

• X = Mouse.X

• Y = Mouse.Y

Done!

Click to Add Event

Select

“Mouse” then

Next!

Select

“On click” then

Next!

Done!

Click to Add Action

Select

“Player” then

Next!

Select

“Spawn another object” then

Next!

Click to Choose

Select

“Bullet” then

OK!

Enter

• Layer = 1

• Image point = 0

Done!

Right-Click

Player then

Edit animations

Click to

Set origin and image points

Click to add

Click in front of gun

Then, close popup

Right-Click

Spawn then

Click Edit

Update

• Image point = 1

Done!

Click to Add Event

Select

“Bullet” then

Next!

Select

“On collision with another object” then

Next!

Click to choose

Select

“Monster” then

OK!

Done!

Click to Add Action

Select

“Monster” then

Next!

Select

“Destroy” then

Done!

Click to Add Action

Select

“Bullet” then

Next!

Select

“Spawn another object” then

Next!

Click to Choose

Select

“Explosion” then

OK!

Enter

• Layer = 1

• Image point = 0

Done!

Click to Add Action

Select

“Bullet” then

Next!

Select

“Destroy” then

Done!

Go to your

Event Sheet

Click to Add Event

Select

“System” then

Next!

Select

“On start of layout” then

Done!

Click to Add Action

Select

“Monster” then

Next!

Select

“Set angle” then

Next!

Enter Angle

• random(360)

Done!

Go to your

Event Sheet

Click to Add Event

Select

“Monster” then

Next!

Select

“Is outside layout” then

Done!

Click to Add Action

Select

“Monster” then

Next!

Select

“Set angle towards position” then

Next!

Enter paramters

• X = Player.X

• Y = Player.Y

Done!

Select Monster

Click

Click Add New

(plus sign)

Enter the following:

• Name: health

• Type: Number

• Initial Value = 5

• Description (optional)

OK!

Right-click

Monster – Destroy then click

Replace action

Select

“Monster” then

Next!

Select

“Subtract from” then

Next!

Enter

• Value = 1

Done!

Download