Presentation is loading. Please wait.

Presentation is loading. Please wait.

Game development.

Similar presentations


Presentation on theme: "Game development."— Presentation transcript:

1 game development

2 game development– learning targets
I will be able to apply variables in physics app I will be able to create single sprites I will be able to write assenting statements I will be able to design geometric shapes

3 game development– common core state standards
1.1 Innovate: Demonstrate creative thinking, construct knowledge and develop innovative products and processes using technology. 1.3 Investigate and Think Critically: Research, manage and evaluate information and solve problems using digital tools and resources 2.4 Adapt to Change (Technology Fluency): Transfer current knowledge to new and emerging technologies L Demonstrate command of the conventions of standard English grammar and usage when writing or speaking. SL Make strategic use of digital media (e.g., textual, graphical, audio, visual, and interactive elements) in presentations to enhance understanding of findings, reasoning, and evidence and to add interest. 9-12 SYSB Systems thinking can be especially useful in analyzing complex situations. To be useful, a system needs to be specified as clearly as possible. 9-12 SYSD Systems can be changing or in equilibrium. S-CP.1. Describe events as subsets of a sample space (the set of outcomes) using characteristics (or categories) of the outcomes, or as unions, intersections, or complements of other events (“or,” “and,” “not”). Reasoning: Unions, intersections and complements of other events are common items to analyze in a project management plan, looking for interdependencies in determining project scheduling and deliverable dates. Project management requires that one be able to analyze those interdependencies. Educational Technology Language Speaking and Listening Science Math

4 board sprite-based objects have speed, gravity, friction (physics engine) game loop (timer event) touch events on sprites

5 coordinates and units positions are based on pixels
X: 480 pixel (0,0) positions are based on pixels Windows Phone 7 platform mandates 480x800 screen resolution origin (0, 0) is top left corner extent (480,800) is just outside of bottom right corner (240,400) Y: (up to) 800 pixel (480,800)

6 coordinates and units sprite positions refer to center of sprite (makes rotation easy) speed measured in pixels/second acceleration measured in pixels/second2

7 demo/exercise: static layout
X: 480 pixel (0,0) var board: Board action main data->board := media->create full board data->board->create ellipse(20,20) data->board->post to wall run script to see static layout Y: (up to) 800 pixel ellipse +(20,20)

8 create ellipse w h create ellipse(w, h)
w is width of enclosing rectangle h is height w h

9 gravity gravity is property of board
Board→set gravity sets the uniform acceleration vector for objects on the board to pixels/seconds2 sprites are affected when Board→evolve is called typical use of the accelerometer in gameloop: var p := senses→acceleration quick→scale(800) ◳board→set gravity(p→x, p→y)

10 demo/exercise: gravity
X: 480 pixel (0,0) var board: Board action main ◳board := media→create full board ◳board→create ellipse(20,20) ◳board→post to wall event game loop var p := senses→acceleration quick→scale(800) ◳board→set gravity(p→x, p→y) ◳board→evolve ◳board→update on wall Y: (up to) 800 pixel ellipse +(20,20) tilt phone to change gravity Important! Moves things around according to speed/gravity/friction/… Important! Makes changes visible

11 exercise try replacing with or
var p := senses→acceleration quick→scale(800) with var p := senses→acceleration quick→scale(2000) or var p := senses→acceleration quick→scale(100) What is the influence of the scaling factor on the sprite movements?

12 obstacles by default, board is open, has no boundary; objects moving off the visual part of the board will simply continue moving away. Use Board→create boundary to create reflecting walls around the board use Board→create obstacle(x,y,w,h,elasticity) to create line obstacle with elasticity: 1 means the entire impulse is maintained 0 means full absorption of the impulse (a sprite will stick to the wall).

13 demo/exercise: boundary
X: 480 pixel (0,0) var board: Board action main ◳board := media→create full board ◳board→create boundary(0) ◳board→create ellipse(20,20) ◳board→post to wall event game loop var p := senses→acceleration quick→scale(800) ◳board→set gravity(p→x, p→y) ◳board→evolve ◳board→update on wall Keep sprites within screen! Y: (up to) 800 pixel ellipse +(20,20) tilt phone to change gravity

14 create obstacle obstacle (x, y) h w (x, y) is upper left corner
create obstacle(x, y, w, h, elasticity) (x, y) is upper left corner obstacle is a straight line (w, h) is size of bounding rectangle (x, y) obstacle h w

15 demo/exercise: obstacle
X: 480 pixel (0,0) var board: Board action main ◳board := media→create full board ◳board→create boundary(0) ◳board→create obstacle(100,100,50,50,1) ◳board→create ellipse(20,20) ◳board→post to wall event game loop var p := senses→acceleration quick→scale(800) ◳board→set gravity(p→x, p→y) ◳board→evolve ◳board→update on wall (100,100) obstacle +(50,50) Y: (up to) 800 pixel ellipse +(20,20) tilt phone to change gravity Important! Moves things around according to speed/gravity/friction/… Important! Makes changes visible

16 friction without friction, ball doesn’t slow down set friction:
default setting for entire board custom setting for each sprite “A friction is the fraction of the forward speed that is experienced as a backwards force.” friction of 0 corresponds to no friction at all friction of 1 means the sprite will not move at all example: board→set friction(0.01)

17 demo/exercise: friction
X: 480 pixel (0,0) var board: Board action main ◳board := media→create full board ◳board→create boundary(0) ◳board→create obstacle(100,100,50,50,1) var ball := ◳board→create ellipse(20,20) ball→set friction(0.05) ◳board→post to wall (new code in bold) (100,100) obstacle +(50,50) Y: (up to) 800 pixel ellipse +(20,20)

18 exercise try replacing with or
ball→set friction(0.05) with ball→set friction(0.95) or ball→set friction(0.001) What is the influence of the friction coefficient on the sprite movements?

19 testing border is the sprite on the left? event gameloop
(50,0) is the sprite on the left? event gameloop if sprite->x < 50 then phone->vibrate(0.1) (0,0) (sprite→ x, sprite→ y) (480,800)

20 exercise is the sprite on the top? event gameloop
if …………………………………………… then phone->vibrate(0.1) (0,0) (sprite→ x, sprite→ y) (0,50) (480,800)

21 extra-exercises is the sprite on the left or on the top?
is the sprite on the bottom? is the sprite on the right? is the sprite on the any of the sides? is the sprite in the center?

22 fun with the board change background color change sprite color
board->set background(colors->random) change sprite color ball->set color(colors->random) make sprite bigger ball->set width(200) ball->set height(400)

23 testing border is the sprite on the left? event gameloop
(50,0) is the sprite on the left? event gameloop if sprite->x < 50 then phone->vibrate(0.1) (0,0) (sprite→ x, sprite→ y) (480,800)

24 testing border is the sprite on the top? event gameloop
if …………………………………………… then phone->vibrate(0.1) (0,0) (sprite→ x, sprite→ y) (0,50) (480,800)

25 testing border is the sprite on the top or bottom? event gameloop
if …………………………………………… then phone->vibrate(0.1) (0,0) (sprite→ x, sprite→ y) (0,50) (480,800)

26 exercise create a game where 1 sprite (called ball)
ball moves with the accelerometer ball bounces on the screen boundary ball is red when it is “near” the center of the screen; otherwise ball is blue ball size increases each time it hits the screen boundary (+5)

27 project pitch 2 min: prepare a 1 minute demo/story why someone should buy your game. At each “beep”, pick a new student and pitch each other’s game. Mark down the other student’s name and whether you would pay .99c to buy his game.

28 Your Name: _____________________
Student’s Name Buy YES! Buy NO!


Download ppt "Game development."

Similar presentations


Ads by Google