Games. learning objectives o writing games! o understanding the built-in 2D game engine o events in games o using art (pictures, sounds)

Slides:



Advertisements
Similar presentations
Sprite-visual object (actor on the stage) Scripts- Tells actors (sprites) what to do.
Advertisements

Create a Simple Game in Scratch
physics engine + graphics
Create a Simple Game in Scratch
events reactive programming
Pages and boxes Building quick user interfaces. learning objectives o Build a quick UI with pages and boxes o understand how pages and boxes work o click.
Cosc 5/4730 Game Design. A short game design primer. A game or animation is built on an animation loop. – Instance variables of “objects” are updated.
Lets Play Catch! Keeping Score in Alice By Francine Wolfe Duke University Professor Susan Rodger May 2010.
Harry Potter Scratch Game
Introduction to TouchDevelop
A Christmas Scratch game
Code Club Session 3 Shark Eats Fish. Picture of finished product here.
This game is loosely based on the Whack-A- Mole arcade game.  Each game starts with 45 seconds of play.  Moles randomly pop out of holes on the landscape.
An Intro to Robots and Computer Programming
LO: Learn how to develop your game further to include interactions with the device.
Scratch the Cat. Object Oriented Programing Writing computer programs Based on Objects Instead of Actions Based on Data Instead of Logic.
1 TouchDevelop Chapter 8-10 Presenter: Jing Xu. 2 Outline Interactions Game Board Tiles and Printing.
Introduction to TouchDevelop
Introduction to Scratch!
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 8 Fall 2010.
Visual Basic .NET BASICS
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.
 graphic organizers in the form of illustrations or images displayed in sequence for the purpose of pre-visualizing a motion picture, animation, motion.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 7 The Game Loop and Animation Starting Out with Games & Graphics.
Learning the skills for programming Advanced Visual Programming.
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 10 Fall 2010.
Learning Unity. Getting Unity
Game Maker Terminology
Scripts what’s in a script – basic language concepts Disclaimer: This document is provided “as-is”. Information and views expressed in this document, including.
Scripts what’s in a script – basic language concepts Disclaimer: This document is provided “as-is”. Information and views expressed in this document, including.
Overview of Game Maker. Game Maker Version 7.0 Lite (free version) For MS-Windows platforms
Creating a Simple Game in Scratch Barb Ericson Georgia Tech June 2008.
CIS125G Computer Game Development. Goals Learn: – How to design games – How games are studied – How games are developed – How to manage software projects.
Lesson 3: Arrays and Loops. Arrays Arrays are like collections of variables Picture mailboxes all lined up in a row, or storage holes in a shelf – You.
Create a Halloween Computer Game in Scratch Stephanie Smullen and Dawn Ellis Barb Ericson October 2008.
1 Project designed and created by M. Shajith Kumar.
24 Background Building 25 Computing Terminology, and Speed/Velocity Module 4 Notes: Sensing, Or Operator, Conditional Logic 28 Module 4 Algorithms,
Scratch Creative Computing. INTRODUCTION TO SCRATCH Section 1.
By Mr. Putnam. In Catfall, the goal of the game is to touch the falling cats with the mouse. Every time you touch a cat, your score goes up by one point.
Getting started with the turtle Find the latest version of this document at
Language Find the latest version of this document at
How to create a basic game in Scratch. The Scratch Stage The Scratch stage is 480 pixels wide and 360 pixels high x increasesx decreases.
Introduction to TouchDevelop Lesson 3 – Comments & Lists Created by S. Johnson
Sprite sets. project of the week: bubble popper o objects appear from the bottom and slide up o player needs to avoid objects to earn points (objects.
Conditionals.
Creating a Simple Game in Scratch Barb Ericson Georgia Tech May 2009.
11. Skier Let’s Learn Saengthong School, June – August 2016 Teacher: Aj. Andrew Davison, CoE, PSU Hat Yai Campus
Boxes. boxes- learning targets o I will be able to display buttons (boxes) o I will be able to organize boxes o I will be able to create an animation.
Collision testing. learning targets Increase awareness of the struggles that of game development; Recognize computer science elements for game logic;
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Martin Norris Computing Teacher/Leader at Moldgreen Community Primary School, Huddersfield
Index Background Costumes Making object walk smoothly Controlling an object with the keyboard Control an object with the mouse Changing costume when hit.
Boxes. SOUNDBOARD Objective: Tap the boxes to play sounds! Demo:
Game development.
Basic coding… with TouchDevelop!!
Create a Halloween Computer Game in Scratch
Scratch for Interactivity
Game development.
Introduction to TouchDevelop
Introduction to TouchDevelop
Explain what touch develop is to your students:
ICT Gaming Lesson 3.
Explain what touch develop is to your students:
Transparency & magic pixel
Creating a Simple Game in Scratch
CSC 221: Introduction to Programming Fall 2018
So you want to be a Game Designer
Presentation transcript:

games

learning objectives o writing games! o understanding the built-in 2D game engine o events in games o using art (pictures, sounds)

language recap o local variables: store and reuse a value var x := 5 x->post to wall o if statement: make decisions! if x = 5 then... else... o for loop: repeat code multiple times for 0 <= i < n do...

global variables o a global variable holds a value in memory and “on disk”; o a global variable can be read or written too; o A global variable is available everywhere definition data->x := 0 x := 0 reading x->post to wall update with new value x := 5 is the shorthand for ‘data’

fruit ninja lite o one sprite shoots up from the bottom of the screen o user needs to tap the sprite before sprite falls back on the bottom o when tapped, the sprite shoots up again from the bottom o 1 point per tap successful o game over if 3 missed sprites

board o 2D sprite-based game engine o physics: sprites have speed, gravity, friction o game loop: timer event to ‘step’ the world o touch events on sprites

coordinates and units o origin (0, 0) is top left corner o landscape or portrait o y coordinates positive going down x y (0,0)

1. basic game template var board: Board action main board := media->create landscape board(800,480) board->post to wall x: 800 y: 480 pixel (0,0) display on screen creates a 2D game engine global variable

1.5 setting up physics var board: Board action main board := media->create landscape board(800,480) board->post to wall board->set gravity(0, 700) event gameloop board->evolve board->update on wall x: 800 y: 480 pixel (0,0) gravity falling down applies physics every 50 ms

2. creating a sprite o create an ellipse in the board o store the sprite in a local variable o promote the sprite variable to data action main... fruit:= board->create ellipse(100, 100) widthheight meaningful name!

3. sprite shooting from the bottom o position the sprite just above bottom of the board o set speed such that the sprite goes up the screen action shoot fruit->set pos(400, 500) fruit->set speed(0, -800) action main... code->shoot x: 800 y: 480 pixel (0,0) (400, 500)

tap sprite event o tap sprite is an event raised when the user taps a sprite. Attaches to a global variable of kind Sprite. event tap sprite: fruit( sprite : Sprite, x : Number, y : Number) name of the global variable (x,y) is the coordinate of the tap

4. tap and shoot o When sprite is tapped, shoot the sprite from the bottom again event tap sprite: fruit(...) code->shoot

5. score o on tap, increase the score by 1 action main... score := 0 event tap sprite: sprite(...)... score := score + 1

6. when the sprite falls through the bottom… o the sprite shoots back action gameloop... if fruit->y > 480 and fruit->speed y > 0 then code->shoot beyond the bottom going down

7. when the sprite falls through the bottom for the 3 rd time… o the user has 3 chances and them game over action main... life := 3 action gameloop... if fruit->y > 800 and fruit->speed y > 0 then life := life – 1 if life post to wall time->stop one life lost no more life, stop the game

customization s

art - pictures o using pictures in your games

background o set screen background color or image wall->set background(color->blue) or… wall->set backround picture(art->background)

picture sprite o use create picture instead of create ellipse o resize the picture (if needed) action main fruit := board->create ellipse(100,100) fruit := board->create picture(art->fruit) var pic := art->picture->clone pic->resize(100,-1) fruit := board->create picture(pic) this is the art we just added

art - sounds o same as picture for sounds still under development in web version o When sprite is tapped, play the splash sound event tap sprite: sprite(...) code->shoot art->splash->play

randomness fruit trajectories the sprite could start from any place at the bottom The sprite could have a little angle to get a bell- shape trajectory make sure the fruit stays in the screen!

randomness fruit trajectories o math->random(5) returns a number between 0 and 5 not included, i.e. 0,1,2,3 or 4. action shoot var x := math->random(540) fruit->set pos(x, 500) var speedx := math->random(100) fruit->set speed(speedx, -800) tweak these values!

leaderboards o use bazaar->post leaderboard score(score) to publish a score online o use bazaar->post leaderboard to wall to display the leaderboard o leaderboards only work on published scripts