Creating Games with Game Maker: Inheritance, Variables, Conditionals. Prof. Jim Whitehead CMPS 80K, Winter 2006 Feb. 8, 2006

Similar documents
Tutorial: Creating maze games

Game Maker Tutorial Creating Maze Games Written by Mark Overmars

Key Abstractions in Game Maker

Key Abstractions in Game Maker

VACUUM MARAUDERS V1.0

Star Defender. Section 1

Storyboard for Playing the Game (in detail) Hoang Huynh, Jeremy West, Ioan Ihnatesn

For more information on how you can download and purchase Clickteam Fusion 2.5, check out the website

Meteor Game for Multimedia Fusion 1.5

GAME:IT Bouncing Ball

Tutorial: A scrolling shooter

Gamelogs: Blogging About Gameplay Definitions of Games and Play Magic Circle

2D Platform. Table of Contents

CONCEPTS EXPLAINED CONCEPTS (IN ORDER)

BE SURE TO COMPLETE HYPOTHESIS STATEMENTS FOR EACH STAGE. ( ) DO NOT USE THE TEST BUTTON IN THIS ACTIVITY UNTIL THE END!

GAME:IT Junior Bouncing Ball

Soccer Cup 2018 simulation Johan Nordling. Unrestricted Siemens AG 2018

The Games Factory 2 Step-by-step Tutorial

Competitive Games: Playing Fair with Tanks

CSci 1113, Spring 2018 Lab Exercise 13 (Week 14): Graphics part 2

Objectives: Create Sprites Create Sounds Create Objects Create Room Program simple game

TATAKAI TACTICAL BATTLE FX FOR UNITY & UNITY PRO OFFICIAL DOCUMENTATION. latest update: 4/12/2013

Narrative and Conversation. Prof. Jim Whitehead CMPS 80K, Winter 2006 February 17, 2006

G54GAM Lab Session 1

Step 1 - Setting Up the Scene

CS 354R: Computer Game Technology

Working with Formulas and Functions

Your challenge is to make the turtles draw a flower pattern on Spaceland and to experiment with different kinds of turtle movement.

CHEAP GOLF EDITOR MANUAL. v 0.11

SPACESHIP (up to 100 points based on ranking)

Experiment 02 Interaction Objects

The Human Calculator: (Whole class activity)

Your First Game: Devilishly Easy

The Stop The Truck! Participation Game

GAME:IT Junior Bouncing Ball

Creating Your Own PowerPoint Jeopardy Game

Expectations. About This Selection. Most students will be able to read and relate to the comic strips.

CS 445 HW#2 Solutions

PLANETOID PIONEERS: Creating a Level!

GameMaker. Adrienne Decker School of Interactive Games and Media. RIT Center for Media, Arts, Games, Interaction & Creativity (MAGIC)

CS188 Spring 2010 Section 3: Game Trees

CSSE220 BomberMan programming assignment Team Project

Shooting in Unity3D (continued)

High-Impact Games and Meaningful Mathematical Dialog Grades 3-5

Kenken For Teachers. Tom Davis January 8, Abstract

Maze Puzzler Beta. 7. Somewhere else in the room place locks to impede the player s movement.

Microsoft Excel Illustrated Unit B: Working with Formulas and Functions

Beginning 3D Game Development with Unity:

This tutorial will guide you through the process of adding basic ambient sound to a Level.

Band New guild creation Less than 10 players in a guild. Order 10 or more players in a guild Guild monument was destroyed

The editor was built upon.net, which means you need the.net Framework for it to work. You can download that here:

the gamedesigninitiative at cornell university Lecture 3 Design Elements

Kindergarten Math. Kindergarten Round-Up Lakeview Public Schools

Using Game Maker. Getting Game Maker for Free. What is Game Maker? Non-event-based Programming: Polling. Getting Game Maker for Free

Using Game Maker. Oregon State University. Oregon State University Computer Graphics

the gamedesigninitiative at cornell university Lecture 3 Design Elements

TBAG: The T ext B ased A dventure G ame Language Project Proposal

Targets for pupils in Year 4

Targets for pupils in Year 4

SCHEDULE USER GUIDE. Version Noventri Suite Schedule User Guide SF100E REV 08

Overview. The Game Idea

Games and the Mathematical Process, Week 2

Play Together, Learn Together. Factor Monster. Bob Albrecht & George Firedrake Copyright (c) 2004 by Bob Albrecht

Game Maker: Platform Game

Once this function is called, it repeatedly does several things over and over, several times per second:

Annex IV - Stencyl Tutorial

A retro space combat game by Chad Fillion. Chad Fillion Scripting for Interactivity ITGM 719: 5/13/13 Space Attack - Retro space shooter game

Building Number Sense K-2

SPACE SPORTS / TRAINING SIMULATION

Maths Workshop Topic Number and Place Value Miss Barrett

Game Design Curriculum Multimedia Fusion 2. Created by Rahul Khurana. Copyright, VisionTech Camps & Classes

Technology and digital images

Before you start, you must go into Advanced Mode. Go to: File > Advanced Mode. You know you are in Advanced Mode when the checkmark appears.

InfoSphere goes Android Angry Blob

Best way to get started with multiplication!

036-ShopDrawings hsbinoutput/shop Drawings

Frankenstein Final. Nature vs. Nurture

More Actions: A Galaxy of Possibilities

Instructions for using Object Collection and Trigger mechanics in Unity

Preserving Your Research Beyond Your Lifetime Using FamilySearch s Family Tree Application.

Data Structure Analysis

THE DADDY QUESTIONS. Adopted Daughter [I was adopted into my family]

SET COMPETITIONS FACILITIES AND SUPPLIES NEEDED. STAFFING There are two different SET competition formats:

The Haberdashers Aske s Boys School Elstree. 11+ Entrance Examination 2010

CS188 Spring 2010 Section 3: Game Trees

Math 259 Winter Recitation Handout 6: Limits in Two Dimensions

5.0 Events and Actions

moose juice recipe maker: pre-picked recipe Juice: Orange Fiesta activity worksheet: Name: Date:

a cooperative card game by Mike Addison 2016

MODEL SETUP FOR RENOVATION PROJECTS INSTRUCTIONS AND TUTORIALS

Paul Wright Revision 1.10, October 7, 2001

Sept. 26, 2012

Solving Who Am I? Puzzles. Building Who Am I? Puzzles. t u Who Am I? The product of my digits is 16. The sum of my digits is 8. Who Am I?

2008 Canadian Computing Competition: Senior Division. Sponsor:

Milton Public Schools Elementary Summer Math

A.1.2 If a player's opponent is unable to cycle their deck (see E.2.2), that player wins the game.

Honors Chemistry Summer Assignment

PoolKit - For Unity.

G54GAM Coursework 2 & 3

2015 Canadian Computing Olympiad Day 2, Problem 1 Cars on Ice

Transcription:

Creating Games with Game Maker: Inheritance, Variables, Conditionals Prof. Jim Whitehead CMPS 80K, Winter 2006 Feb. 8, 2006

Similar Behavior When creating a game, you often have a situation where you have the same object, but with slightly different behavior Example: two monsters that look the same, have same collision behavior, but have different paths Example: several monster types may have the same collision behavior, but have different kinds of movement, and look different Ideally want to specify the behavior that is the same just once Can be really boring to repeat the same collision behavior for 20-30 slightly different monster types Plus, if you ever need to make a change to this behavior, you need to make the change in 20-30 places. Yikes!

Inheriting Behavior Game Maker provides the ability to: State behavior common to many objects in one place Indicate which objects use this common behavior General idea: Objects can optionally have a parent If an object has a parent, the parent s behavior is used by the child So, if my parent says collisions with a bullet destroy me (the parent) then it is also the case that collisions with a bullet destroy me (the child). The technical term for this is inheritance you inherit the behavior from your parent.

Inheritance Example Mother-of-monsters Parent-child relationship Big-hairy-monster Tiny-smelly-monster This behavior is inherited from Motherof-monsters it is not specified in Bighairy-monster.

Inheritance Example Mother-of-monsters Action: play sound argh! A single change in the parent is inherited by all children Parent-child relationship Big-hairy-monster Action: play sound argh! Tiny-smelly-monster Action: play sound argh!

Overriding Behavior It is usually the case that children want some, but not all of their parent s behavior Example: want parent s collision behavior, but don t want parent s creation behavior For example, want to set a different path than the parent in the create event hander A child s specification of behavior overrides that of its parent Example: parent says on create event, do action set path to big-path child says on create event, do action set path to small-path In this case, the child s specification is used That is, the path is set to small-path for all child objects The child s specification overrides the parent s specification

Example of Overriding Behavior Mother-of-monsters Event: creation Action: set path to big-path Parent-child relationship Big-hairy-monster Event: creation Action: set path to big-path Tiny-smelly-monster Event: creation Action: set path to small-path All behaviors inherited from parent Collide behavior inherited from parent, creation behavior is set locally, and overrides parent

Setting Parent in Game Maker In the object dialog box, in the leftmost column, there is a selection Parent A pick list lets you identify the parent object Typically you will create a non-visible object to be the parent This object will never be used directly in the game only its children will appear

Game Maker Demo Switch to Game Maker, and show Space Eggs 2006 demo This demo shows inheritance for the behavior of the space eggs, and the monsters Two non-visible objects are created to hold behavior mother-of-all-spaceegs mother-of-all-monsters

Conditionals In games, very typically you need to have the behavior of the game depend on the current state of the game Examples: Continue to the next level when there are no monsters left on this level Only allow two bullets on screen at a time Have a powerup appear when the player has bopped all monsters in a given wave

Conditionals The typical form that these take is: If (the game is in a certain state) Then Perform an action Else Perform some other action This is known as a conditional Perform the action only on the condition that the game is in a certain state, otherwise perform some other action

Conditionals in Game Maker Game Maker has just one idiom Actions are performed in reaction to Events Conditionals are placed into Actions This creates a slight mismatch, as typically you have one action per entry Conditionals spread across multiple action entries

Variable A variable holds a value A variable has a name and a value Example: Num_monsters has the value of 6 Can perform arithmetic on variables Addition, subtraction, multiplication, division Can be very useful for representing game state in your game In Space Eggs example, the number of monsters still to be destroyed before the end of the level Subtract one from this every time a monster is hit When it is zero, move to the next level Set variables in actions, and can check the value of variables using conditionals

Game Maker Demo Go to Space Eggs 2006 demo and show how conditionals are used to limit the number of bullets to 2 at any one time Also show how conditionals are used to end one level (room), and move to the next level (room)