Creative Commons Attribution 3.0 creativecommons.org/licenses/by/3.0/ Creating a Platformer in Game Maker Foundations of Interactive Game Design Prof.

Slides:



Advertisements
Similar presentations
Interaction Design: Visio
Advertisements

GAME:IT Junior Paddle Ball Objectives: Review skills from Introduction Create a background Add simple object control (up and down) Add how to create a.
GAME:IT Junior Learning Game Maker: The Control Tab.
Create a Simple Game in Scratch
Summer Computing Workshop. Introduction to Variables Variables are used in every aspect of programming. They are used to store data the programmer needs.
Create a Simple Game in Scratch
Congratulations! You have just installed the Presentation Game Add-In.
Horizontal Scrolling through Tileset Levels Game Design Experience Professor Jim Whitehead March 4, 2008 Creative Commons Attribution 3.0 creativecommons.org/licenses/by/3.0.
Creative Commons Attribution 3.0 creativecommons.org/licenses/by/3.0 Key Abstractions in Game Maker Foundations of Interactive Game Design Prof. Jim Whitehead.
Creative Commons Attribution 3.0 creativecommons.org/licenses/by/3.0/ Creating a Platformer in Game Maker Part 2 Foundations of Interactive Game Design.
Microsoft PowerPoint ® 2003 Carl B. Struck Presentation Graphics n Educational, business, sales and other presentations (slide shows) n Combination of.
Windows 8 Windows Phone 8 Web Mobile … and WakeUpAndCode.com.
Backgrounds, Inheritance in GameMaker (BrickMania 1 of 2) Foundations of Interactive Game Design Professor Jim Whitehead January 28, 2008 Creative Commons.
INTRODUCTION TO SCRATCH. About Me Resources Scratch Website Learn Scratch Washington-Lee Computer.
GAME:IT Junior Bouncing Ball Objectives: Create Sprites Create Sounds Create Objects Create Room Program simple game.
GameMaker.  A lot of Different Definitions  Easier to Say What is NOT a Game  Movie is Not a Game  No Active Participation  Final Outcome is Fixed.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. M I C R O S O F T ® Animating and Using Multimedia Effects Lesson 10.
Game Design Creating a game called PING Phase 3: Steps for building basic game.
Creative Commons Attribution 3.0 creativecommons.org/licenses/by/3.0 Key Abstractions in Game Maker Foundations of Interactive Game Design Prof. Jim Whitehead.
© Cheltenham Computer Training 2001 Macromedia Dreamweaver 4 - Slide No 1 Macromedia Dreamweaver 4 Advanced Level Course.
Introduction to TouchDevelop
Backgrounds, Inheritance in GameMaker (BrickMania 1 of 2) Foundations of Interactive Game Design Professor Jim Whitehead January 28, 2008 Creative Commons.
GAME:IT Bouncing Ball Objectives: Create Sprites Create Sounds Create Objects Create Room Program simple game.
Game Maker Day 2 Making a Maze Game.
VIDEO GAME PROGRAMMING Video Game Programming Junior – DigiPutt INSTRUCTOR TEACHER’S ASSISTANT.
GAME:IT Junior Learning Game Maker: The Move Tab.
Learning Game Maker Studio:
InDesign CS3 Lesson 4 ( Only pages ) Importing and Editing Text.
Art 315 Lecture 5 Dr. J. Parker AB 606. Last time … We wrote our first program. We used a tool called GameMaker. The program we wrote causes a ball to.
Art 315 Lecture 6 Dr. J. Parker. Variables Variables are one of a few key concepts in programming that must be understood. Many engineering/cs students.
 graphic organizers in the form of illustrations or images displayed in sequence for the purpose of pre-visualizing a motion picture, animation, motion.
> 1 Diagrams in Word Faculty of Health Alan Grace.
Photo Story 3 Importing Pictures. When you create a new Photo Story, the first thing that you will do is import pictures. You can import pictures from.
1. Press the New Layer Button 3. Double click names to re-name Ball & Shadow layers 2. Click to change to 12 fps Step 1.
11 Adding Tomato Targets Session Session Overview  We now have a game which lets a player bounce a piece of cheese on a bread bat  Now we have.
Learning Unity. Getting Unity
Game Maker Terminology
Game Maker – Getting Started What is Game Maker?.
Shooters in GameMaker J Parker.
Creating a Simple Game in Scratch Barb Ericson Georgia Tech June 2008.
Game Maker Tutorial.
2D Platform Game Game Maker Terminology. Object  Item in a game that has behavior, such as a main character who can move.
Create a Halloween Computer Game in Scratch Stephanie Smullen and Dawn Ellis Barb Ericson October 2008.
Monday, October 26 th Entry Task Write two questions you have about chapter 4 and/or the test. Schedule: Chapter 4 quiz 19.1 Electric charge Homework:
Game Maker Evil Clutches.
Scratch for Interactivity Dr. Ben Schafer Department of Computer Science University of Northern Iowa.
Construct 2 Game Development for Kids Platformer Tutorial: Part 1 Shahed Chowdhuri.
GAME:IT Junior Paddle Ball Objectives: Review skills from Introduction Create a background Add simple object control (up and down) Add how to create a.
GAME:IT Paddle Ball Objectives: Review skills from Introduction Create a background Add simple object control (up and down) Add how to create a simple.
Choose Sprite. Add collision event for object and add score action. Set your score to plus 100 and check relative.
ICT/COMPUTING RULES Only use software allowed by the teacher
Introduction to Game Programming & Design III Lecture III.
GAME:IT Mario Creating Platform Games Level 4 with GML Game Maker Language (GML) allows users more flexibility in game design. GML is similar to how real.
The Stingray Example Program CMT3311. Stingray - an example 2D game May be useful as a simple case study Most 2D games need to solve generic problems.
Creating a Simple Game in Scratch Barb Ericson Georgia Tech May 2009.
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
School of Computer Science Space School 2015 Programming a Lunar Lander Game.
Moving Platforms, Scrolling Backgrounds in Game Maker
MORE Genre Specific Physics
Scratch for Interactivity
Game Maker Intro to Programming Game Maker Pop Quiz (Both Groups)
Background Shapes & Collision Resolution (Top-down and Side-scrolling)
Finish the Scratch Presentations Game Maker
Creating games with game editors
Game Maker Intro to Programming Game Maker Pop Quiz (Both Groups)
Creating a Simple Game in Scratch
So you want to be a Game Designer
Project 2 Dragonfly.
Presentation transcript:

Creative Commons Attribution 3.0 creativecommons.org/licenses/by/3.0/ Creating a Platformer in Game Maker Foundations of Interactive Game Design Prof. Jim Whitehead February 15, 2008

Upcoming Assignments Gamelog ‣ Game from classics list ‣ Due next Wednesday, February 20, at midnight

Upcoming Assignments Multi-game analysis essay ‣ Due next week, on Friday ‣ Pick three games that are familiar to you. ‣ They must be: ❖ All in same genre, OR ❖ Three installments in a series of games, from different console/computer eras ‣ Pick a single aspect of game design, and compare/contrast how the three games address this aspect of game design ❖ How do they create challenge and conflict? ❖ Strengths and weaknesses in level design across the games? ❖ How do game rules contribute to gameplay? ❖ Use of characters in the game. How does this foster gameplay? Narrative flow? Not more than 4 pages typed ‣ An individual assignment More details and assessment criteria on the course website

Game Design Workshops Game Maker ‣ Wednesdays, 6-8pm ‣ Engineering 2, room 180 (Simularium) ❖ Enter on plaza level between E2 and JBE RPG Maker ‣ Wednesdays, 5-7:15pm, Engineering 2, room 280 ‣ NEW: Thursdays, 5-7:15pm, Engineering 2, room 215 CS 20/C# and XNA Game Studio Express ‣ Thursdays, 4:30-7pm ‣ Engineering 2, room 399 (third floor, by elevators)

Key Mechanics of Platformers To create a platform game, need to ‣ Handle collision with platforms ‣ Handle jumping ‣ Scrolling view in large game world ‣ Interactions with other enemies and items in gameworld Today, will focus on ‣ collision detection ‣ jumping ‣ scrolling view

Collision Detection Collision detection is the bane of platform game designers in Game Maker Several factors affect collision detection ‣ Type of bounding box ❖ Automatic, full image, manually defined bounding box (defined in Sprite) ‣ Type of collision detection ❖ precise, non-precise (defined in Sprite) ‣ Whether object is solid ❖ Defined in object ‣ Actions taken in response to a collision event ❖ Defined in object ‣ May need to examine multiple dialog boxes to completely understand collision detection behavior

Bounding Box Bounding box is a rectangle (or square) drawn around a sprite image, used for collision detection ‣ Typically, is outer boundary of the sprite image ❖ Game Maker selects this using the “Automatic” feature under “Bounding Box” in the Sprite dialog ‣ Can manually set the size of the bounding box ❖ Example: if creating a bullet hell (manic) shmup, may want to make the vulnerable region of the ship smaller than the visible sprite ❖ Select “Manual” under “Bounding Box” in Sprite dialog, then fill in dimensions ‣ Can also set to the full size of the sprite file ❖ If sprite is defined in 48x48 pixel box, “Full image” option would make bounding box the full 48x48 pixels, even if sprite image is smaller Bounding box Visible sprite image

Basic Collision Detection Bounding box Visible sprite image Bounding box overlap Non-precise collision detection: Just overlap of bounding boxes. May mean sprite images do not overlap (player would visually perceive a near miss) Bounding box Visible sprite image Image overlap and Bounding box overlap Precise collision detection: Must have overlap of bounding boxes and sprite images must overlap. Best collision detection, but more computationally expensive. Unless you choose otherwise, this is the collision detection behavior sprites use. To toggle between these collision detection modes: Choose “Precise collision checking” in Sprite dialog box

Step sequence in Game Maker Begin step: generate Begin Step event Save current position of object Compute new position ‣ x = old_x + hspeed ‣ y = old_y + vspeed ‣ But, don’t move sprite just yet! Determine if there is a collision at the new position ‣ If either object in collision is solid: reset position: x = old_x, y = old_y ‣ In both cases (solid, not solid), now generate Collision event Generate Step event Update visual representation of sprite on screen ‣ Draw sprite at new location (x, y) End step: generate End Step event

My sprite is embedded in a wall: why? In tick 2 (both objects not solid) ‣ Compute new position: y = old_y + vspeed (y = = 115) ‣ Actions in collision event just set vspeed to 0 ❖ Actions do not modify position of the object ‣ Visual depiction of objects updated to new position ‣ Sprite is now embedded in a wall y: 105 y: 110 vspeed: 10 y: 115 y: 110 End of Tick 1End of Tick 2 Ball and Wall are both not solid

My sprite stopped above the wall: why? In tick 2 (one or both objects solid) ‣ Store old positions old_y = y, old_x = x ‣ Compute new position: y = old_y + vspeed (y = = 115) ‣ Check for collision at new position: yes ‣ Revert to old position (y = y_old = 105) ‣ Do actions in collision event ❖ Set vspeed to 0 ‣ Draw sprite: now stopped in mid-air y: 105 y: 110 vspeed: 10 End of Tick 1 Either Ball or Wall or both are solid y: 105 y: 110 vspeed: 0 End of Tick 2

My sprite fell through a wall: why? Velocity of ball is so great that in one tick its position is incremented such that it never intersects the wall. y: 105 y: 110 vspeed: 20 End of Tick 1 Will occur for solid and non-solid objects y: 115 y: 125 y: 110 vspeed: 20 End of Tick 2 y: 115 y: 100 y: 120

Directions in Game Maker Direction angles in Game Maker are different from normal. 0o0o 90 o 180 o 270 o

Gravity Can set “gravity” in Game Maker Very simple ‣ Define a speed and a direction ‣ Every step, the speed is added to the player’s current speed ‣ This is a dv/dt (change in velocity per change in time), hence is acceleration ‣ Normal gravity is an acceleration downwards of 9.8 m/s 2 ‣ To create sensation of downward gravity in Game Maker ❖ Use “Set the gravity” action ❖ Have direction be 270 ❖ Set speed to 2 Arbitrary value This speed may vary with your gameworld, tune until it feels right

Jumping Jumping behavior ‣ Press a key, and player jumps up ‣ Pressing key while in the air should not result in more jumping ❖ Unless you intentionally want a “double-jump”, in which case you only want to allow two, and only two jumps. ‣ Jumping should not affect side-to-side movement ‣ Need to decide if player can change side-to-side direction in mid-air ‣ Need to handle collisions correctly ❖ Not going into the side of platforms ❖ Correctly landing on the top of platforms ❖ Correctly handling jumps up into platforms

Handling Jump Keypress Need a simple state machine Create a variable called “jumping” on player ‣ Set to 0 initially ‣ Can only jump when it is 0 ‣ Set to 1 when jumping Not jumping vspeed=0 gravity=0 Jumping vspeed > 0 gravity > 0 Keypress Collision with ground

Details of Creating State Machine Initialize variable jumping ‣ Add “Set variable to a value” action to Create event for player ‣ “Var” square on Control tab in Object window ❖ Variable: jumping ❖ Value: 0 ❖ Relative: must be unchecked Add jumping logic ‣ Add keyboard event ‣ Add variable conditional ❖ Octagon with “Var” on Control tab of Object window ❖ Applies to “self” ❖ Variable: jumping ❖ Value: 0 ❖ Operation: equal to ❖ Creates conditional: if jumping = 0 then... {then behavior on next slide}

Details of Creating State Machine (2) Then behavior if jumping = 0 in keypress event ‣ Add a “Start of a block” (grey up triangle on Control tab) ❖ Equivalent to curly braces found in many languages ❖ Means: “group the following actions together until the end of block” ‣ Set vertical speed to a negative number ❖ Downward red arrow on Move tab of Object window ❖ Yes, click the down arrow to make your player go up ❖ Tunable value, try vert. speed of -25 to -30 for starters ‣ Set variable jumping to 1 ❖ That is, we have shifted to the “jumping” state in our simple state machine ❖ “Var” square on Control tab of Object Applies to “self” Variable: jumping Value: 1 Relative: unchecked ‣ Add an “End of a block” (grey down tirangle on Control tab)

Details of Creating a State Machine (3) OK, have initialization and state transition to jumping state Now need transition back to non-jumping state When a collision is detected, need to set jumping to 0 ‣ In collision event with Wall ❖ Set vertical speed to 0 Down red arrow on Move tab of Object Set vert. speed to 0 ❖ Set variable jumping to 0 Var square on Control tab of Object Applies to “self” variable: jumping value: 0

Drawbacks of the State Machine Collision events between player and wall do not distinguish the three cases ‣ Ball landing on top of wall ‣ Ball hitting side of platform ‣ Ball hitting underside of platform Currently, state machine leads to following behavior ‣ Sticking to side of a platform (ball or wall is solid) ❖ Player receives collision event, and sets vspeed to 0 ❖ Gravity should cause player to fall, but gravity never has chance to affect position ❖ Solid object behavior means collision event occurs before ball actually moved ❖ Horizontal movement means ball keeps going towards platform ❖ Results in a collision every step!

Drawbacks of the State Machine Hitting the underside of the platform also has problems ‣ Ball strikes underside of platform ‣ Causes collision event ❖ Sets vspeed to 0 ❖ Also sets jumping to 0 Can’t distinguish between landing on platform, and jumping up into underside of platform ‣ Result: undesired perpetual double-jump ability How do I fix all of this? ‣ Complicated: details in class on Wednesday...