Game Design Week 1 Introduction and Objects Competition
Game Design Week 1 - Introduction and Objects
Competition! Your Hero Broad theme, be creative The more creative and interesting your take, the better Focus will be on design and ideas, not programming
What is a game?
What is a game? A game is an activity played using a sets of rules There are many types of games - Board games Video games Card games Word games Sports General concepts apply across the board for games
Game General Concepts Games (especially video games and board games) can be made up of any number of a few different elements: ● Mechanics ● Visuals ● Narrative Games will ALWAYS have mechanics, but not always visuals or narrative, and are always interactive in some way
Game Mechanics
What are mechanics? Rules that together form the constraints and functionality of the game Defines how things like combat, interactions, etc work Mechanics are the absolute core of any game
Your examples? What games do you play? What mechanics does the game have?
Breaking down mechanics Breaking blocks in Minecraft
Breaking down mechanics Breaking blocks in Minecraft 1. Player clicks the left mouse button (click event) 2. Character’s arm punches (animation) 3. Character’s arm checks to see if it’s hitting a block (collision detection) 4. If block is being hit, it starts to break (damage) When click is held down, this repeats until the block takes enough damage to break
Let’s look at the elements ➢ Player Character ○ ○ ○ Character skin Animations Interactions from events ■ Movement, punching, placing blocks ➢ Block ○ ○ ○ Type Texture Damage limit How do we define these things in code?
Objects
What is an Object? In real life, an object can be anything! (seriously) All objects in the world have properties - for example, a car has a color , weight , max speed , and loads of other stuff Some objects have methods - like functions or actions - for example, a car can start , drive , break , etc
The Base Object We use objects in games when we want to create a sort of “model” of how something should be described For example, a “car” is made up of a main body with 4 wheels that can drive, stop, and change directions These details remain the same, regardless of the car, but other things like the color, size, speed etc can change
The Base Object A Java. Script object is essentially a collection of: ● Properties; variables with values that describe aspects of the object, and ● Methods; functions which describe what actions the object can take, or what it can do
Object Properties Name: Tesla Roadster Color: Red Year: 2019 Top Speed: 250+mph Name: FIAT 500 Color: White Year: 2008 Top Speed: 120 mph
Objects can be written like variables, but use { } Each property take the form of ⇒ property : value
Working with Properties The values of properties can be accessed using object. property What will the following give us: car. name car. weight
Adding an object Method
Working with Methods can be easily run from objects using object. method() So what do you think will happen if we say car. drive()? HINT: In Java. Script, the thing called "owns" the method/property. this , is the object that
Other ways of creating objects
Other ways of creating objects
Other ways of creating objects
Useful Links W 3 Schools Javascript Objects https: //www. w 3 schools. com/js/js_objects. asp W 3 Schools Javascript Object Constructors https: //www. w 3 schools. com/js/js_object_constructors. asp
- Slides: 27