SlideShare une entreprise Scribd logo
1  sur  44
Windows 8  Windows Phone 8  Web  Mobile  … and more! 
WakeUpAndCode.com 
@shahedC
Prerequisites 
• Ghost Shooter Tutorial 
• Flapping Bird Tutorial 
Both available at: 
Construct 2 – Step by Step 
• http://wakeupandcode.com/construct-2-step-by-step/
Step 1: Save a New Project, “platformer.capx” 
Save! 
Enter 
File name
Step 2: Change Layout size 
Layout Size 
• Width = 4000 
• Height = 2048
Step 3: Prepare Your Layers 
Bottom layer 
• Rename it “Background” 
• Remember to Lock it later! 
New layer 
• Add new layer 
• Rename it “Main”
Step 4: Add Background, update properties 
Update: 
• Name 
• Position 
• Size
Step 5: Add New Sprite -> Tile 
Tips: 
• Rename sprite object to “Tile” 
• Check “Snap to Grid”. 
• Ctrl-Click and Drag to create more.
Step 6: Add New Sprite -> Player 
Tips: 
• Rename sprite object to “Player” 
• Rename Default animation to “Idle” 
• Set origin to bottom center point
Step 7: Add New Sprite -> PlayerBox 
Tips: 
• Rename sprite object to “PlayerBox” 
• Set origin to bottom center point
Step 8: Cover Player with PlayerBox 
Tips: 
• Resize PlayerBox to match Player 
• Position PlayerBox over Player
Step 9: Add Behaviors to PlayerBox 
Add the following behaviors: 
• Platform 
• ScrollTo
Step 10: Update PlayerBox Properties 
Update the following for Platform: 
• Jump Strength = 750 
• Gravity = 2500 
Also update: 
• Initial visibility = Invisible
Step 11: Add Behaviors to Tile object 
Add the following behaviors: 
• Solid
Step 12: Add Event for Player to follow Box 
Add Event 
• Object: System 
• Condition: Every tick 
• Action: 
• Object: Player 
• Event: Set position to PlayerBox (image point 0)
Step 13: Add Keyboard Support 
Tips: 
• Insert New Object  Keyboard 
• Add 2 events for Left/Right
Step 14: Update Project Window Size 
Tip: Set Window Size: 800, 600
Step 15: Create More Tiles 
Tip: Ctrl-Click and Drag to create more tiles
Step 16: Add Run and Jump Animations 
Tips: 
• Right-Click Animations window to Add each animation 
• Import Sprite Strip as 4x4 for each 
• Remove empty frames 
• Clean up any stray pixels 
• Rename to “Run” and “Jump”, respectively 
• Set origin to bottom center point for all frames
Step 17: Add Events for Running and Stopping 
Add Events 
• Object: PlayerBox 
• Condition: (Platform) On moved 
• Action: 
• Object: Player 
• Event: Set animation to “Run” 
Add Events 
• Object: PlayerBox 
• Condition: (Platform) On stopped 
• Action: 
• Object: Player 
• Event: Set animation to “Idle”
Step 18: Add Event for Jumping and Landing 
Add Event 
• Object: PlayerBox 
• Condition: (Platform) On jump 
• Action: 
• Object: Player 
• Event: Set animation to “Jump” 
Add Event with sub-events 
• Object: PlayerBox 
• Condition: (Platform) On landed 
• Sub-events: (see details below)
Step 19: Add New Sprite -> Enemy 
Tips: 
• Rename sprite object to “Enemy” 
• Set origin to bottom center point
Step 20: Place enemies on blocks 
Tip: Ctrl-Click and Drag to copy enemy
Step 21: Add Behaviors to Player object 
Add the following behaviors: 
• Flash
Step 22: Add New Event for Collision 
Add Event 
• Object: PlayerBox 
• Condition: On collision with another object  Enemy 
• Action:
Step 23: Add New Event for Collision 
Add Sub-Event: 
• Object: PlayerBox 
• Condition: (Platform) is falling 
Add another condition: 
• Object: PlayerBox 
• Condition: (Compare Y) < Enemy.Y 
Add Actions: 
• Object: Enemy 
• Event: Destroy 
• Object: PlayerBox 
• Event: Set (Platform) vector Y 
• Value: -700
Step 24: Add Else for Collision 
Add Else condition: 
• Object: System 
• Condition: Else 
• Action: 
• Object: Player 
• Action: Flash 0.1 on 0.1 off after 1.0 seconds
Step 25: Add Behaviors to Enemy 
Add the following behaviors: 
• Platform
Step 26: Update Enemy Platform Behavior 
Update the following: 
• Max Speed: 50 
• Acceleration: 100 
• Deceleration: 100 
• Default Controls: No
Step 27: Add New Sprite -> Edge 
Tips: 
• Rename sprite object to “Edge”
Step 28: Place along edges using Ctrl + Drag 
Tip: Make the Edge object Invisible
Step 29: Add New instance variable to Enemy 
Instance Variable: 
• Name: action 
• Type: Text 
• Initial value: left 
• Description (optional)
Step 30: Create Event for “right” movement 
Add Event: 
• Object: Enemy 
• Condition: (compare instance variable), action = “right” 
• Action: 
• Object: Enemy 
• Action: Simulate (platform) pressing Right 
• Object: Enemy 
• Action: Set Mirrored
Step 31: Create Event for “left” movement 
Add Event: 
• Object: Enemy 
• Condition: (compare instance variable), action = “left” 
• Action: 
• Object: Enemy 
• Action: Simulate (platform) pressing Left 
• Object: Enemy 
• Action: Set Not mirrored
Step 32: Create Event for Edge collision 
Add Event: 
• Object: Enemy 
• Condition: On collision with Edge 
• Action:
Step 33: Create Sub-Event with Actions 
Add Sub-Event: 
• Object: Enemy 
• Condition: (compare instance variable), action = “right” 
• Action: 
• Object: Enemy 
• Action: (Set value) action to “left”
Step 34: Create Else Condition 
Add Else Condition: 
• Object: System 
• Condition: Else 
• Action: 
• Object: Enemy 
• Action: (Set value) action to “right”
Step 35: Add New Sprite -> Platform 
Tips: 
• Rename sprite object to “Platform” 
• Place it higher than a Tile. 
• Ctrl-Click and Drag to create more.
Step 36: Add Behavior to Platform 
Add the following behaviors: 
• Jump-thru
Step 37: Add New Event for Player falling out 
New Event 
• Object: Player 
• Condition: Is outside layout 
• Action: 
• Object: System 
• Action: Restart layout
Step 38: Add Moving Platforms 
Add Behavior 
• Sine
Step 39: Customize Graphics 
Download Free Graphics 
• Free Bundle from Scirra: 
• http://www.scirra.com/freebundle.zip 
• Top-down shooter + zombies: 
• http://gfxpax.blogspot.com/2011/07/top-down-shooter-zombie-pack.html 
• Tiled Backgrounds, etc: 
• http://sandbox.yoyogames.com/make/resources
Step 40: Export to HTML5 Website 
Export Project
Play Your Game!!!
(END of Platformer tutorial) 
• Derived from ‘How to make a Platform game’ originally published by 
Ashley 
• Updated with different graphics and simplified animations

Contenu connexe

Tendances

드래곤 네스트 인벤토리 시스템 역 기획서 Ver1.1.A
드래곤 네스트 인벤토리 시스템 역 기획서 Ver1.1.A드래곤 네스트 인벤토리 시스템 역 기획서 Ver1.1.A
드래곤 네스트 인벤토리 시스템 역 기획서 Ver1.1.A
ganmaru
 
Camera shots, Angles, Movement and Composition final
Camera shots, Angles, Movement and Composition finalCamera shots, Angles, Movement and Composition final
Camera shots, Angles, Movement and Composition final
RianneWright96
 
Elements of Game Design
Elements of Game DesignElements of Game Design
Elements of Game Design
myati
 
Microsoft Publisher Overview
Microsoft Publisher OverviewMicrosoft Publisher Overview
Microsoft Publisher Overview
Gregory Donaghy
 

Tendances (20)

Improving LTV with Personalized Live Ops Offers: Hill Climb Racing 2 Case Stu...
Improving LTV with Personalized Live Ops Offers: Hill Climb Racing 2 Case Stu...Improving LTV with Personalized Live Ops Offers: Hill Climb Racing 2 Case Stu...
Improving LTV with Personalized Live Ops Offers: Hill Climb Racing 2 Case Stu...
 
LiveOps 101 | Andrew Munden
LiveOps 101 | Andrew MundenLiveOps 101 | Andrew Munden
LiveOps 101 | Andrew Munden
 
Gamification Workshop 2010
Gamification Workshop 2010Gamification Workshop 2010
Gamification Workshop 2010
 
Game Elements
Game ElementsGame Elements
Game Elements
 
드래곤 네스트 인벤토리 시스템 역 기획서 Ver1.1.A
드래곤 네스트 인벤토리 시스템 역 기획서 Ver1.1.A드래곤 네스트 인벤토리 시스템 역 기획서 Ver1.1.A
드래곤 네스트 인벤토리 시스템 역 기획서 Ver1.1.A
 
Labeled parts of a camera
Labeled parts of a cameraLabeled parts of a camera
Labeled parts of a camera
 
Camera shots, Angles, Movement and Composition final
Camera shots, Angles, Movement and Composition finalCamera shots, Angles, Movement and Composition final
Camera shots, Angles, Movement and Composition final
 
TouchSpin Gaming Investor Deck
TouchSpin Gaming Investor DeckTouchSpin Gaming Investor Deck
TouchSpin Gaming Investor Deck
 
LAFS SVI Level 2 - Psychology of Play
LAFS SVI Level 2 - Psychology of PlayLAFS SVI Level 2 - Psychology of Play
LAFS SVI Level 2 - Psychology of Play
 
2-Game Design (Game Design and Development)
2-Game Design (Game Design and Development)2-Game Design (Game Design and Development)
2-Game Design (Game Design and Development)
 
Introduction to Level Design
Introduction to Level DesignIntroduction to Level Design
Introduction to Level Design
 
Photography 101, Or How to Take Better Photos
Photography 101, Or How to Take Better PhotosPhotography 101, Or How to Take Better Photos
Photography 101, Or How to Take Better Photos
 
Pembelajaran 3 Pengenalan blender
Pembelajaran 3 Pengenalan blenderPembelajaran 3 Pengenalan blender
Pembelajaran 3 Pengenalan blender
 
2 D게임 프로그래밍 발표 자료
2 D게임 프로그래밍 발표 자료2 D게임 프로그래밍 발표 자료
2 D게임 프로그래밍 발표 자료
 
Elements of Game Design
Elements of Game DesignElements of Game Design
Elements of Game Design
 
Adobe Flash CS4 - Shape tween
Adobe Flash CS4 - Shape tweenAdobe Flash CS4 - Shape tween
Adobe Flash CS4 - Shape tween
 
Level design for games
Level design for gamesLevel design for games
Level design for games
 
트레블헌터 개발기획서
트레블헌터 개발기획서트레블헌터 개발기획서
트레블헌터 개발기획서
 
Game Development Company, Flash Game Development,
Game Development Company, Flash Game Development,Game Development Company, Flash Game Development,
Game Development Company, Flash Game Development,
 
Microsoft Publisher Overview
Microsoft Publisher OverviewMicrosoft Publisher Overview
Microsoft Publisher Overview
 

Similaire à Construct 2 Platformer: Step by Step

ARTDM 170, Week 7: Scripting Interactivity
ARTDM 170, Week 7: Scripting InteractivityARTDM 170, Week 7: Scripting Interactivity
ARTDM 170, Week 7: Scripting Interactivity
Gilbert Guerrero
 

Similaire à Construct 2 Platformer: Step by Step (20)

Panduan platform game dengan Construct 2
Panduan platform game dengan Construct 2Panduan platform game dengan Construct 2
Panduan platform game dengan Construct 2
 
ARTDM 170, Week 7: Scripting Interactivity
ARTDM 170, Week 7: Scripting InteractivityARTDM 170, Week 7: Scripting Interactivity
ARTDM 170, Week 7: Scripting Interactivity
 
Game Salad Study
Game Salad StudyGame Salad Study
Game Salad Study
 
Developing VR Experiences with Unity
Developing VR Experiences with UnityDeveloping VR Experiences with Unity
Developing VR Experiences with Unity
 
ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2
ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2
ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2
 
C++ Windows Forms L02 - Controls P1
C++ Windows Forms L02 - Controls P1C++ Windows Forms L02 - Controls P1
C++ Windows Forms L02 - Controls P1
 
Lecture2_practice.pdf
Lecture2_practice.pdfLecture2_practice.pdf
Lecture2_practice.pdf
 
HoloLens Programming Tutorial: AirTap & Spatial Mapping
HoloLens Programming Tutorial: AirTap & Spatial MappingHoloLens Programming Tutorial: AirTap & Spatial Mapping
HoloLens Programming Tutorial: AirTap & Spatial Mapping
 
[Advantech] WebOP designer Tutorial step by step
[Advantech] WebOP designer Tutorial step by step [Advantech] WebOP designer Tutorial step by step
[Advantech] WebOP designer Tutorial step by step
 
2006 - Basta!: Advanced server controls
2006 - Basta!: Advanced server controls2006 - Basta!: Advanced server controls
2006 - Basta!: Advanced server controls
 
Lecture 4: ITS488 Digital Content Creation with Unity - Game and VR Programming
Lecture 4: ITS488 Digital Content Creation with Unity - Game and VR Programming Lecture 4: ITS488 Digital Content Creation with Unity - Game and VR Programming
Lecture 4: ITS488 Digital Content Creation with Unity - Game and VR Programming
 
Mobile AR Lecture6 - Introduction to Unity 3D
Mobile AR Lecture6 - Introduction to Unity 3DMobile AR Lecture6 - Introduction to Unity 3D
Mobile AR Lecture6 - Introduction to Unity 3D
 
Having fun power apps components HandsOn - Power Platform World Tour Copenhag...
Having fun power apps components HandsOn - Power Platform World Tour Copenhag...Having fun power apps components HandsOn - Power Platform World Tour Copenhag...
Having fun power apps components HandsOn - Power Platform World Tour Copenhag...
 
Ninja Cat Flyer - 1 of 6
Ninja Cat Flyer - 1 of 6Ninja Cat Flyer - 1 of 6
Ninja Cat Flyer - 1 of 6
 
The Fine Art of JavaScript Event Handling
The Fine Art of JavaScript Event HandlingThe Fine Art of JavaScript Event Handling
The Fine Art of JavaScript Event Handling
 
OnlineLearning Makers Fair - Stencyl
OnlineLearning Makers Fair - StencylOnlineLearning Makers Fair - Stencyl
OnlineLearning Makers Fair - Stencyl
 
Introduction to Unity
Introduction to UnityIntroduction to Unity
Introduction to Unity
 
C++ Windows Forms L10 - Instantiate
C++ Windows Forms L10 - InstantiateC++ Windows Forms L10 - Instantiate
C++ Windows Forms L10 - Instantiate
 
Cardboard VR: Building Low Cost VR Experiences
Cardboard VR: Building Low Cost VR ExperiencesCardboard VR: Building Low Cost VR Experiences
Cardboard VR: Building Low Cost VR Experiences
 
eAdventureEN
eAdventureENeAdventureEN
eAdventureEN
 

Plus de Shahed Chowdhuri

Plus de Shahed Chowdhuri (20)

ASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web AppsASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web Apps
 
ASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web AppsASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web Apps
 
Cloud-Backed Mixed Reality: HoloLens & Azure Cognitive Services
Cloud-Backed Mixed Reality: HoloLens & Azure Cognitive ServicesCloud-Backed Mixed Reality: HoloLens & Azure Cognitive Services
Cloud-Backed Mixed Reality: HoloLens & Azure Cognitive Services
 
ASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web AppsASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web Apps
 
Cloud-Backed Mixed Reality with HoloLens & Azure Cognitive Services
Cloud-Backed Mixed Reality with HoloLens & Azure Cognitive ServicesCloud-Backed Mixed Reality with HoloLens & Azure Cognitive Services
Cloud-Backed Mixed Reality with HoloLens & Azure Cognitive Services
 
Microsoft Cognitive Services
Microsoft Cognitive ServicesMicrosoft Cognitive Services
Microsoft Cognitive Services
 
Intro to Bot Framework v3 with DB
Intro to Bot Framework v3 with DBIntro to Bot Framework v3 with DB
Intro to Bot Framework v3 with DB
 
Game On with Windows & Xbox One @ .NET Conf UY
Game On with Windows & Xbox One @ .NET Conf UYGame On with Windows & Xbox One @ .NET Conf UY
Game On with Windows & Xbox One @ .NET Conf UY
 
Game On with Windows & Xbox One!
Game On with Windows & Xbox One!Game On with Windows & Xbox One!
Game On with Windows & Xbox One!
 
Going Serverless with Azure Functions
Going Serverless with Azure FunctionsGoing Serverless with Azure Functions
Going Serverless with Azure Functions
 
ASP.NET Core 2.0: The Future of Web Apps
ASP.NET Core 2.0: The Future of Web AppsASP.NET Core 2.0: The Future of Web Apps
ASP.NET Core 2.0: The Future of Web Apps
 
Azure for Hackathons
Azure for HackathonsAzure for Hackathons
Azure for Hackathons
 
Intro to Xamarin: Cross-Platform Mobile Application Development
Intro to Xamarin: Cross-Platform Mobile Application DevelopmentIntro to Xamarin: Cross-Platform Mobile Application Development
Intro to Xamarin: Cross-Platform Mobile Application Development
 
Xbox One Dev Mode
Xbox One Dev ModeXbox One Dev Mode
Xbox One Dev Mode
 
What's New at Microsoft?
What's New at Microsoft?What's New at Microsoft?
What's New at Microsoft?
 
Capture the Cloud with Azure
Capture the Cloud with AzureCapture the Cloud with Azure
Capture the Cloud with Azure
 
Intro to HoloLens Development + Windows Mixed Reality
Intro to HoloLens Development + Windows Mixed RealityIntro to HoloLens Development + Windows Mixed Reality
Intro to HoloLens Development + Windows Mixed Reality
 
Intro to Bot Framework v3
Intro to Bot Framework v3Intro to Bot Framework v3
Intro to Bot Framework v3
 
Azure: PaaS or IaaS
Azure: PaaS or IaaSAzure: PaaS or IaaS
Azure: PaaS or IaaS
 
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with Overview
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

Construct 2 Platformer: Step by Step

  • 1. Windows 8  Windows Phone 8  Web  Mobile  … and more! WakeUpAndCode.com @shahedC
  • 2. Prerequisites • Ghost Shooter Tutorial • Flapping Bird Tutorial Both available at: Construct 2 – Step by Step • http://wakeupandcode.com/construct-2-step-by-step/
  • 3. Step 1: Save a New Project, “platformer.capx” Save! Enter File name
  • 4. Step 2: Change Layout size Layout Size • Width = 4000 • Height = 2048
  • 5. Step 3: Prepare Your Layers Bottom layer • Rename it “Background” • Remember to Lock it later! New layer • Add new layer • Rename it “Main”
  • 6. Step 4: Add Background, update properties Update: • Name • Position • Size
  • 7. Step 5: Add New Sprite -> Tile Tips: • Rename sprite object to “Tile” • Check “Snap to Grid”. • Ctrl-Click and Drag to create more.
  • 8. Step 6: Add New Sprite -> Player Tips: • Rename sprite object to “Player” • Rename Default animation to “Idle” • Set origin to bottom center point
  • 9. Step 7: Add New Sprite -> PlayerBox Tips: • Rename sprite object to “PlayerBox” • Set origin to bottom center point
  • 10. Step 8: Cover Player with PlayerBox Tips: • Resize PlayerBox to match Player • Position PlayerBox over Player
  • 11. Step 9: Add Behaviors to PlayerBox Add the following behaviors: • Platform • ScrollTo
  • 12. Step 10: Update PlayerBox Properties Update the following for Platform: • Jump Strength = 750 • Gravity = 2500 Also update: • Initial visibility = Invisible
  • 13. Step 11: Add Behaviors to Tile object Add the following behaviors: • Solid
  • 14. Step 12: Add Event for Player to follow Box Add Event • Object: System • Condition: Every tick • Action: • Object: Player • Event: Set position to PlayerBox (image point 0)
  • 15. Step 13: Add Keyboard Support Tips: • Insert New Object  Keyboard • Add 2 events for Left/Right
  • 16. Step 14: Update Project Window Size Tip: Set Window Size: 800, 600
  • 17. Step 15: Create More Tiles Tip: Ctrl-Click and Drag to create more tiles
  • 18. Step 16: Add Run and Jump Animations Tips: • Right-Click Animations window to Add each animation • Import Sprite Strip as 4x4 for each • Remove empty frames • Clean up any stray pixels • Rename to “Run” and “Jump”, respectively • Set origin to bottom center point for all frames
  • 19. Step 17: Add Events for Running and Stopping Add Events • Object: PlayerBox • Condition: (Platform) On moved • Action: • Object: Player • Event: Set animation to “Run” Add Events • Object: PlayerBox • Condition: (Platform) On stopped • Action: • Object: Player • Event: Set animation to “Idle”
  • 20. Step 18: Add Event for Jumping and Landing Add Event • Object: PlayerBox • Condition: (Platform) On jump • Action: • Object: Player • Event: Set animation to “Jump” Add Event with sub-events • Object: PlayerBox • Condition: (Platform) On landed • Sub-events: (see details below)
  • 21. Step 19: Add New Sprite -> Enemy Tips: • Rename sprite object to “Enemy” • Set origin to bottom center point
  • 22. Step 20: Place enemies on blocks Tip: Ctrl-Click and Drag to copy enemy
  • 23. Step 21: Add Behaviors to Player object Add the following behaviors: • Flash
  • 24. Step 22: Add New Event for Collision Add Event • Object: PlayerBox • Condition: On collision with another object  Enemy • Action:
  • 25. Step 23: Add New Event for Collision Add Sub-Event: • Object: PlayerBox • Condition: (Platform) is falling Add another condition: • Object: PlayerBox • Condition: (Compare Y) < Enemy.Y Add Actions: • Object: Enemy • Event: Destroy • Object: PlayerBox • Event: Set (Platform) vector Y • Value: -700
  • 26. Step 24: Add Else for Collision Add Else condition: • Object: System • Condition: Else • Action: • Object: Player • Action: Flash 0.1 on 0.1 off after 1.0 seconds
  • 27. Step 25: Add Behaviors to Enemy Add the following behaviors: • Platform
  • 28. Step 26: Update Enemy Platform Behavior Update the following: • Max Speed: 50 • Acceleration: 100 • Deceleration: 100 • Default Controls: No
  • 29. Step 27: Add New Sprite -> Edge Tips: • Rename sprite object to “Edge”
  • 30. Step 28: Place along edges using Ctrl + Drag Tip: Make the Edge object Invisible
  • 31. Step 29: Add New instance variable to Enemy Instance Variable: • Name: action • Type: Text • Initial value: left • Description (optional)
  • 32. Step 30: Create Event for “right” movement Add Event: • Object: Enemy • Condition: (compare instance variable), action = “right” • Action: • Object: Enemy • Action: Simulate (platform) pressing Right • Object: Enemy • Action: Set Mirrored
  • 33. Step 31: Create Event for “left” movement Add Event: • Object: Enemy • Condition: (compare instance variable), action = “left” • Action: • Object: Enemy • Action: Simulate (platform) pressing Left • Object: Enemy • Action: Set Not mirrored
  • 34. Step 32: Create Event for Edge collision Add Event: • Object: Enemy • Condition: On collision with Edge • Action:
  • 35. Step 33: Create Sub-Event with Actions Add Sub-Event: • Object: Enemy • Condition: (compare instance variable), action = “right” • Action: • Object: Enemy • Action: (Set value) action to “left”
  • 36. Step 34: Create Else Condition Add Else Condition: • Object: System • Condition: Else • Action: • Object: Enemy • Action: (Set value) action to “right”
  • 37. Step 35: Add New Sprite -> Platform Tips: • Rename sprite object to “Platform” • Place it higher than a Tile. • Ctrl-Click and Drag to create more.
  • 38. Step 36: Add Behavior to Platform Add the following behaviors: • Jump-thru
  • 39. Step 37: Add New Event for Player falling out New Event • Object: Player • Condition: Is outside layout • Action: • Object: System • Action: Restart layout
  • 40. Step 38: Add Moving Platforms Add Behavior • Sine
  • 41. Step 39: Customize Graphics Download Free Graphics • Free Bundle from Scirra: • http://www.scirra.com/freebundle.zip • Top-down shooter + zombies: • http://gfxpax.blogspot.com/2011/07/top-down-shooter-zombie-pack.html • Tiled Backgrounds, etc: • http://sandbox.yoyogames.com/make/resources
  • 42. Step 40: Export to HTML5 Website Export Project
  • 44. (END of Platformer tutorial) • Derived from ‘How to make a Platform game’ originally published by Ashley • Updated with different graphics and simplified animations

Notes de l'éditeur

  1. Title Page: Intro to Indie Game Development Windows  Web  Xbox  Mobile By Shahed Chowdhuri Technical Evangelist Blog: WakeUpAndCode.com Twitter: @shahedC