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.

Slides:



Advertisements
Similar presentations
Create a Simple Game in Scratch
Advertisements

Summer Computing Workshop. Introduction to Variables Variables are used in every aspect of programming. They are used to store data the programmer needs.
Key Stage 3 ICT Lesson 2 - Programming. Starter Start Kodu. Re-familiarise yourself with how it works. Play some of the pre-made games. Try and change.
Lets Play Catch! Keeping Score in Alice By Francine Wolfe Duke University Professor Susan Rodger May 2010.
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 07 Fall 2010.
Justus Nyagwencha Game Maker. Getting started -> Resources The icons across the top are very important All the things you add to the game are called “Resources”.
Mrs. Chapman. Tabs (Block Categories) Commands Available to use Script Area where you type your code Sprite Stage All sprites in this project.
Extending the Pong Example Barb Ericson Georgia Tech June 2011.
Mr. Wortzman. Tabs (Block Categories) Available Blocks Script Area Sprite Stage All sprites in this project.
4 Things that affect your pictures… ISO Aperture Shutter Speed LIGHT.
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.
Fish Chomp. The screen where you can see what happens when you play your game is called the STAGE. The SCRIPT BANK is where the types of instructions.
GameMaker Workshop Geoff Cameron Sarah Scialli. What this workshop will teach you GameMaker GameMaker No Programming Required No Programming Required.
Creative Commons Attribution 3.0 creativecommons.org/licenses/by/3.0 Key Abstractions in Game Maker Foundations of Interactive Game Design Prof. Jim Whitehead.
The Physics of Basketball
Art 315 Lecture 4 Dr. J. Parker AB 606 Today’s class: Programming! We are going to write some simple programs. We will use a tool called GameMaker –It.
Introduction to TouchDevelop
Backgrounds, Inheritance in GameMaker (BrickMania 1 of 2) Foundations of Interactive Game Design Professor Jim Whitehead January 28, 2008 Creative Commons.
Introduction to Scratch!
GAME:IT Bouncing Ball Objectives: Create Sprites Create Sounds Create Objects Create Room Program simple game.
Game Maker Day 2 Making a Maze Game.
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 8 Fall 2010.
VIDEO GAME PROGRAMMING Video Game Programming Junior – DigiPutt INSTRUCTOR TEACHER’S ASSISTANT.
Using MIT Scratch for Programming and Control Exercise 3 Ball Game Year 9 ICT Autumn Term 2007.
Learning Game Maker Studio:
We will be creating a spaceship that simulates real movements in space. The spaceship will fire a laser beam that can destroy targets. The spaceship will.
KeyListener and Keyboard Events Just as we can implement listeners to handle mouse events, we can do the same for keyboard events (keypresses) –to implement.
Alice Pong Recreating Pong in Alice By Elizabeth Liang under the direction of Professor Susan Rodger Duke University June 2010.
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.
How to make a Shooting Target game in Scratch!. WE ARE GOING TO MAKE A TARGET GAME. This game will have: A Target that will move when clicked. A Timer.
Programming games Show your version of Bo the dog. Start cannonball Preview: video, audio work session (cannonball) Homework: Cannonball with ball in a.
Moving Around in Scratch The Basics… -You do want to have Scratch open as you will be creating a program. -Follow the instructions and if you have questions.
2015 CSE/EGR Summer Camps 1 Computer Science Concepts 1. What is an algorithm? 2. Binary information coding 3. Programming concepts via Scratch Designed.
GAME:IT Helicopter Objectives: Review skills in making directional sprites Create objects that shoot and destroy for points Create random enemies on the.
GAME:IT Pinball Objectives: Review skills from Introduction Introduce gravity and friction Introduce GML coding into programming.
Catch the Clown Tutorial Tech Camp Fall 2008 Colorado School of Mines.
Game Maker Terminology
Art 321 VIDEO Dr. J. Parker AB 606. Recording and Editing Video All you frustrated Spielbergs out there now get your special lecture. First, let’s loot.
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.
ENGR-TS-2: The students will develop an understanding of how the design process is used to develop a technological system.
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.
Week 6. Statistics etc. GRS LX 865 Topics in Linguistics.
Variables and Random Numbers Computer App Session 4.
Today we are learning to: Understand how actions and events control our game. Completing the catch the clown game – making a room – adding music Gather.
Game Maker Evil Clutches.
Scratch for Interactivity Dr. Ben Schafer Department of Computer Science University of Northern Iowa.
Tank Game Part 3 of 6. Secondary Weapons and Pick ups Pick ups will appear randomly in the battle area and can be collected by driving into them. Each.
Repetition everywhere – comparing while in a method and as an event Susan Rodger Duke University July 2010.
Introduction to TouchDevelop Lesson 3 – Comments & Lists Created by S. Johnson
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.
Tank Game Part 2 of 6. Firing Shells Coming up… Players Scores Large Explosions Small Explosions Damage Health Bars Parent Shell Destructible Walls Reappear.
The Law of Averages. What does the law of average say? We know that, from the definition of probability, in the long run the frequency of some event will.
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.
Creating a Simple Game in Scratch Barb Ericson Georgia Tech May 2009.
AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Intro to Action Script 11 "The games of a people reveal.
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.
Scratch for Interactivity
Game Maker Intro to Programming Game Maker Pop Quiz (Both Groups)
Game Engines By James Tedder.
Introduction to TouchDevelop
Go to =>
Game Maker Intro to Programming Game Maker Pop Quiz (Both Groups)
So you want to be a Game Designer
Presentation transcript:

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 move left when we type aleft arrow key. That’s all.

This is a program? The equivalent C code for a PC would be between lines long. Let’s continue with the program. There are three other directions to move the ball, let’s do that first.

Gamemaker Double click on the file L0401.gmk from last time and it will open in GameMaker. Now we can edit things, add new ones, and run the program.

GameMaker Add event -> Key Press -> Right

GameMaker Add event -> Key Press -> Up

… and Down Add event -> Key Press -> Down

Run the program

The Program This program is now bigger and better than a typical ‘Hello, World’, but still has very little in the way of function. Most programs in intro programming classes are, in fact, pure demonstrations, and have no other real value. They are pedagogical tools. Ours will ultimately become something else.

The Relative Box This determines whether the motion/direction specified is absolute or relative. If Relative is unchecked, then motion is absolute. EG Speed = 1 (unit/turn) If checked, the motion is relative to the current motion. That is, speed=1 means add 1 to the current speed.

Relative If the motions we specified are made relative, Then each time an arrow is pressed the speed will change. We can make the ball go faster and slower. Well, faster, anyhow. Why can’t we make it go slower?

Slower? We could make it go slower, we just asked incorrectly. What we asked for was a relative change in speed of +1 and specified a new direction. So it will go faster with each key press, but in a new direction, just as we asked. How can we get it to move slower?

Slower? The combination of speed and direction change is called velocity. We can change speed by adding to the speed value. Making the speed value negative makes the ball go ‘backwards’, or in the opposite direction. (going DOWN with negative speed means going UP)

Slower? So we could specify the DOWN motion as a negative change in the UP speed. We could specify RIGHT motion as a negative change in LEFT speed. Right is –ve left Down is –ve up

The Result

Gravity You may recall that in the Move menu there is an item for gravity. It does what you probably think – it pulls the object in a specified direction.

Gravity Problem: just turning gravity on the ball will make it fall, past the bottom of the room, and forever. Let’s do it anyhow. When??? We can turn gravity on when the ball is created, in this case it will be when the program starts to run.

Gravity Creation is an event. Make a new event for Create and as the action, select the gravity item. Set gravity down, and with intensity 1. When does the creation event occur? In this case, when the program starts running (green arrow pushed)

Falling The ball falls. Good. It falls quickly, and passes off of the visible part of the screen. I guess this is to be expected (but did you?) Programs are often guilty of this kind of unexpected behaviour; that which could have been predicted, but which did not seem obvious. How can we keep the ball on the screen?

Build a Floor We could build a floor, an object that the ball could collide with. This works as before: create a sprite (get a texture, set centre), create an object using that sprite. Then place those objects in a row along the bottom of the room. Important: make the object solid by checking the box. (ball too)

The Room Looks Like This:

Are we Done? Nope. If you run this program, the ball falls as before, passing right through the floor. Why? All interactions have to be specifically allowed and accounted for in a program. We did not do this.

We Program A Collision With the Floor Double click on ‘obj_ball’ and select Add Event->Collision Select the obj_wall as the collision target. This will allow us to create some code to deal with a collision between the ball and the wall (floor)

Collision Code What do we want to happen? The ball should stop falling, I guess. I set the vertical speed to 0. There are other ways to do this. Tell me what they are:

Gravity, Balls, and such In the ‘real’ world, a ball usually bounces. Can we write a program to do that? Of course. When the ball collides with the floor, is should change Direction instead of stopping. There is a Motion item that does that. Making it seem realistic is a bit trickier.

Bouncing You should play with this problem too. My solution: - Set vertical speed to -3 relative - Reverse vertical direction Why -3 relative? Because I tried -1 and -2 and it Did not seem realistic. Why reverse vertical direction? Because that’s what a bounce is. The gravity setting automatically pulls the ball down again, and so it bounces again …

Bouncing

What Have We Learned? (about programming, that is) We have to understand how to do it before we can write a program to do it. We can experiment with a program if we don’t know exactly what to do. Programs can do things we may not have anticipated (usually this is our fault) Programming can be fun. * (RH)

Now Lets Have Some Fun It’s called ‘GameMaker’, so let’s make a game. We can make a ball move around, and ‘fall’ in simulated gravity. Sounds a bit like basketball. But perhaps we can do better. Ideas?

An Opponent or Target Conflict is a key aspect of game design. I suggest a target, as an opponent is harder. Each time the ball, controlled by the player, collides with a new object, a target, then a point will be scored. Make it challenging – reverse the control directions left for right.

Game Reverse control directions: Pressing left key goes right, right key goes left.

Make a Target Target could be another ball-type object that moves. Or a ‘goal’-like thing. Ideas??

Goal You will make your own game in the lab. Mine will have a goal, and a wall protecting it. Behind the goal is a target that moves. Quite tricky.

Scores In a game, there must be some sort of goal or objective to be achieved. Often this is recognized by an increase in a value called the score. In a shooting game, for instance, the score increases whenever an opponent is shot or destroyed.

Scores Because GameMaker was designed to make games, there is a built-in mechanism for keeping track of the score.

Score Set Score Test score Draw score Score is a name that represents a value, the number of ‘points’ earned by the player. It can be incremented, decremented, or displayed. You get to decide how points are added/subtracted.

Score

Variable Score is an example of a variable. This will be the subject of the next class.