8. organizing your layout

125
8. Organizing Your Layout

Upload: yeriel

Post on 24-Feb-2016

22 views

Category:

Documents


0 download

DESCRIPTION

8. Organizing Your Layout. Organize Your Layout: Step 1. Right-click to Rename each sprite. Organize Your Layout: Step 2. Name them: Player Monster Bullet Explosion. Bonus Step: Update Blend Mode. Change Blend Mode to Additive. Organize Your Layout: Step 3. Zoom Out: - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: 8. Organizing Your Layout

8. Organizing Your Layout

Page 2: 8. Organizing Your Layout

Organize Your Layout: Step 1

Right-click to Rename

each sprite

Page 3: 8. Organizing Your Layout

Organize Your Layout: Step 2

Name them:• Player• Monster• Bullet• Explosion

Page 4: 8. Organizing Your Layout

Bonus Step: Update Blend Mode

Change Blend Modeto Additive

Page 5: 8. Organizing Your Layout

Organize Your Layout: Step 3Zoom Out:

• Ctrl + Scroll

Page 6: 8. Organizing Your Layout

Organize Your Layout: Step 4

Move thebullet andexplosion

outside theLayout

Page 7: 8. Organizing Your Layout

Organize Your Layout: Done!

Page 8: 8. Organizing Your Layout

9. Moving the Player

Page 9: 8. Organizing Your Layout

Move The Player: Step 1

Select Player

Page 10: 8. Organizing Your Layout

Move The Player: Step 2

Click

Page 11: 8. Organizing Your Layout

Move The Player: Step 3

Click Add New(plus sign)

Page 12: 8. Organizing Your Layout

BUT FIRST… KNOW YOUR MOVEMENTS!

ScrollUpOrDown

Page 13: 8. Organizing Your Layout

Move The Player: Step 4

Select“8 Direction”

then

Click Add

Page 14: 8. Organizing Your Layout

Move The Player: Step 5

Click Again

Page 15: 8. Organizing Your Layout

Move The Player: Step 6

Click Add New(plus sign) again

Page 16: 8. Organizing Your Layout

Move The Player: Step 7

Select“Scroll To”

then

Click Add

Page 17: 8. Organizing Your Layout

Move The Player: Step 8

Click Add New(plus sign) again

Page 18: 8. Organizing Your Layout

Move The Player: Step 9

Select“Bound Tolayout”

thenClick Add

Page 19: 8. Organizing Your Layout

Move The Player: Step 10

Closepopup

Page 20: 8. Organizing Your Layout

Move The Player: Done!

Page 21: 8. Organizing Your Layout

10. Adding Behaviors

Page 22: 8. Organizing Your Layout

Add Behaviors: Step 1

Select Bullet

Page 23: 8. Organizing Your Layout

Add Behaviors: Step 2

Click

Page 24: 8. Organizing Your Layout

Add Behaviors: Step 3

Click Add New(plus sign)

Page 25: 8. Organizing Your Layout

Add Behaviors: Step 4

Select“Bullet”

then

Click Add

Page 26: 8. Organizing Your Layout

Add Behaviors: Step 5

Click Add New(plus sign) again

Page 27: 8. Organizing Your Layout

Add Behaviors: Step 6

Select“Destroyoutside layout”

thenClick Add

Page 28: 8. Organizing Your Layout

Add Behaviors: Step 7

Closepopup

Page 29: 8. Organizing Your Layout

Add Behaviors: Step 8

Select Explosion

Page 30: 8. Organizing Your Layout

Add Behaviors: Step 9

Click

Page 31: 8. Organizing Your Layout

Add Behaviors: Step 10

Click Add New(plus sign)

Page 32: 8. Organizing Your Layout

Add Behaviors: Step 11

Select“Fade”

then

Click Add

Page 33: 8. Organizing Your Layout

Add Behaviors: Step 12

Closepopup

Page 34: 8. Organizing Your Layout

Add Behaviors: Step 13

Update BulletSpeed = 600

Update ExplosionFade out time = 0.5

Page 35: 8. Organizing Your Layout

Add Behaviors: Done!

Page 36: 8. Organizing Your Layout

11. Moving NPCsi.e. non-playable characters

Page 37: 8. Organizing Your Layout

Move Monsters: Step 1

Select Monster

Page 38: 8. Organizing Your Layout

Move Monsters: Step 2

Click

Page 39: 8. Organizing Your Layout

Move Monsters: Step 3

Click Add New(plus sign)

Page 40: 8. Organizing Your Layout

Move Monsters: Step 4

Select“Bullet”

then

Click Add

Page 41: 8. Organizing Your Layout

Move Monsters: Step 5

Closepopup

Page 42: 8. Organizing Your Layout

Move Monsters: Step 6

Update Monster’s Bullet BehaviorSpeed = 80

Page 43: 8. Organizing Your Layout

Move Monsters: Step 7

Select Monster

Ctrl-Click and Dragto create more!

Page 44: 8. Organizing Your Layout

Move Monsters: Done!

Page 45: 8. Organizing Your Layout

12. Accepting User Input

Page 46: 8. Organizing Your Layout

Add Mouse Event: Step 1

Add events to theEvent Sheet

Page 47: 8. Organizing Your Layout

BUT FIRST… KNOW ABOUT EVENTS!

ObjectCondition

Event

An “Event” happens

when a Condition is True

for an Object

Page 48: 8. Organizing Your Layout

Add Mouse Event: Step 2

Right-Click, then Add

Event

Page 49: 8. Organizing Your Layout

Add Mouse Event: Step 3

Select “System”

then

Next!

Page 50: 8. Organizing Your Layout

Add Mouse Event: Step 4

Select “Every tick”

then

Done!

Page 51: 8. Organizing Your Layout

Add Mouse Event: Step 5

Click to Add Action

Page 52: 8. Organizing Your Layout

Add Mouse Event: Step 6

Select “Player”

then

Next!

Page 53: 8. Organizing Your Layout

Add Mouse Event: Step 7

Select “Set angle toward position”then

Next!

Page 54: 8. Organizing Your Layout

Add Mouse Event: Step 8

Enter Parameters• X = Mouse.X• Y = Mouse.Y

Done!

Page 55: 8. Organizing Your Layout

Add Mouse Event: Done!

Page 56: 8. Organizing Your Layout

13. Spawning Other Objectse.g. Bullets

Page 57: 8. Organizing Your Layout

Shoot Bullets: Step 1

Click to Add Event

Page 58: 8. Organizing Your Layout

Shoot Bullets: Step 2

Select “Mouse”

then

Next!

Page 59: 8. Organizing Your Layout

Shoot Bullets: Step 3

Select “On click”

then

Next!

Page 60: 8. Organizing Your Layout

Shoot Bullets: Step 4

Done!

Page 61: 8. Organizing Your Layout

Shoot Bullets: Step 5

Click to Add Action

Page 62: 8. Organizing Your Layout

Shoot Bullets: Step 6

Select “Player”

then

Next!

Page 63: 8. Organizing Your Layout

Shoot Bullets: Step 7

Select “Spawn another object”then

Next!

Page 64: 8. Organizing Your Layout

Shoot Bullets: Step 8

Click to Choose

Page 65: 8. Organizing Your Layout

Shoot Bullets: Step 9

Select “Bullet”

then

OK!

Page 66: 8. Organizing Your Layout

Shoot Bullets: Step 10

Done!

Enter• Layer = 1• Image point = 0

Page 67: 8. Organizing Your Layout

Shoot Bullets: Done!

Page 68: 8. Organizing Your Layout

14. Image Points

Page 69: 8. Organizing Your Layout

Fix Bullets: Step 1

Right-ClickPlayerthenEdit animations

Page 70: 8. Organizing Your Layout

Fix Bullets: Step 2

Click to Set origin and image

points

Page 71: 8. Organizing Your Layout

Fix Bullets: Step 3

Click to add

Page 72: 8. Organizing Your Layout

Fix Bullets: Step 4

Click infront of gun

Then, close popup

Page 73: 8. Organizing Your Layout

Fix Bullets: Step 5

Right-ClickSpawnthenClick Edit

Page 74: 8. Organizing Your Layout

Fix Bullets: Step 6

Done!

Update• Image point = 1

Page 75: 8. Organizing Your Layout

15. Collision Detection

Page 76: 8. Organizing Your Layout

Destroy Monsters: Step 1

Click to Add Event

Page 77: 8. Organizing Your Layout

Destroy Monsters: Step 2

Select “Bullet”

then

Next!

Page 78: 8. Organizing Your Layout

Destroy Monsters: Step 3

Select “On collision with another object”then

Next!

Page 79: 8. Organizing Your Layout

Destroy Monsters: Step 4

Click to choose

Page 80: 8. Organizing Your Layout

Destroy Monsters: Step 5

Select “Monster”

then

OK!

Page 81: 8. Organizing Your Layout

Destroy Monsters: Step 6

Done!

Page 82: 8. Organizing Your Layout

Destroy Monsters: Step 7

Click to Add Action

Page 83: 8. Organizing Your Layout

Destroy Monsters: Step 8

Select “Monster”

then

Next!

Page 84: 8. Organizing Your Layout

Destroy Monsters: Step 9

Select “Destroy”then

Done!

Page 85: 8. Organizing Your Layout

Destroy Monsters: Step 10

Click to Add Action

Page 86: 8. Organizing Your Layout

Destroy Monsters: Step 11

Select “Bullet”

then

Next!

Page 87: 8. Organizing Your Layout

Destroy Monsters: Step 12

Select “Spawn another object”then

Next!

Page 88: 8. Organizing Your Layout

Destroy Monsters: Step 13

Click to Choose

Page 89: 8. Organizing Your Layout

Destroy Monsters: Step 14

Select “Explosion”

then

OK!

Page 90: 8. Organizing Your Layout

Destroy Monsters: Step 15

Done!

Enter• Layer = 1• Image point = 0

Page 91: 8. Organizing Your Layout

Destroy Monsters: Step 16

Click to Add Action

Page 92: 8. Organizing Your Layout

Destroy Monsters: Step 17

Select “Bullet”

then

Next!

Page 93: 8. Organizing Your Layout

Destroy Monsters: Step 18

Select “Destroy”then

Done!

Page 94: 8. Organizing Your Layout

Destroy Monsters: Done!

Page 95: 8. Organizing Your Layout

16. Basic AI e.g. enemy placement

Page 96: 8. Organizing Your Layout

Randomize Monsters: Step 1

Go to yourEvent Sheet

Page 97: 8. Organizing Your Layout

Randomize Monsters: Step 1

Click to Add Event

Page 98: 8. Organizing Your Layout

Randomize Monsters: Step 3

Select “System”

then

Next!

Page 99: 8. Organizing Your Layout

Randomize Monsters: Step 4

Select “On start of layout”

then

Done!

Page 100: 8. Organizing Your Layout

Randomize Monsters: Step 5

Click to Add Action

Page 101: 8. Organizing Your Layout

Randomize Monsters: Step 6

Select “Monster”

then

Next!

Page 102: 8. Organizing Your Layout

Randomize Monsters: Step 7

Select “Set angle”then

Next!

Page 103: 8. Organizing Your Layout

Randomize Monsters: Step 8

Enter Angle• random(360)

Done!

Page 104: 8. Organizing Your Layout

Randomize Monsters: Done!

x

Page 105: 8. Organizing Your Layout

17. Improved AI e.g. follow the player

Page 106: 8. Organizing Your Layout

Improve Monsters: Step 1

Go to yourEvent Sheet

Page 107: 8. Organizing Your Layout

Improve Monsters: Step 2

Click to Add Event

Page 108: 8. Organizing Your Layout

Improve Monsters: Step 3

Select “Monster”

then

Next!

Page 109: 8. Organizing Your Layout

Improve Monsters: Step 4

Select “Is outside

layout”then

Done!

Page 110: 8. Organizing Your Layout

Improve Monsters: Step 5

Click to Add Action

Page 111: 8. Organizing Your Layout

Improve Monsters: Step 6

Select “Monster”

then

Next!

Page 112: 8. Organizing Your Layout

Improve Monsters: Step 7

Select “Set angletowards position”thenNext!

Page 113: 8. Organizing Your Layout

Improve Monsters: Step 8

Enter paramters• X = Player.X• Y = Player.Y

Done!

Page 114: 8. Organizing Your Layout

Improve Monsters: Done!

Page 115: 8. Organizing Your Layout

18. Instance Variablese.g. NPC Health

Page 116: 8. Organizing Your Layout

Add Health: Step 1

Select Monster

Page 117: 8. Organizing Your Layout

Add Health: Step 2

Click

Page 118: 8. Organizing Your Layout

Add Health: Step 3

Click Add New(plus sign)

Page 119: 8. Organizing Your Layout

Add Health: Step 4

Enter the following:• Name: health• Type: Number• Initial Value = 5• Description (optional)

OK!

Page 120: 8. Organizing Your Layout

Add Health: Done!

Page 121: 8. Organizing Your Layout

Update Health: Step 1

Right-clickMonster – Destroy

then

click Replace action

Page 122: 8. Organizing Your Layout

Update Health: Step 2

Select “Monster”

then

Next!

Page 123: 8. Organizing Your Layout

Update Health: Step 3

Select “Subtract from”then

Next!

Page 124: 8. Organizing Your Layout

Update Health: Step 4

Enter• Value = 1

“Monster”“Monster”

Done!

Page 125: 8. Organizing Your Layout

Update Health: Done!