2D Platform Games: Tiles & Scrolling

Slides:



Advertisements
Similar presentations
GAME:IT Junior Learning Game Maker: The Score Tab.
Advertisements

CSE 380 – Computer Game Programming Tile Based Graphics Legend of Zelda, by Nintendo, released 1987.
1 CMPCD2041 Computer Game Design, Programming and Engineering Lecture 14-B 2007/2008 2D Graphical Techniques Dr. Sudirman Slides prepare by Mike Baskett.
Drawing In One-Point Perspective
Using 2D sprite with OpenGL 2003 team Koguyue. Overview Motivation and basic concepts Advantages with using OpenGL Basic requirements of implementation.
Quiz Time What button stops the sprite from vanishing off the screen?
Platform Code Cookbook. Put code into the Platform The higher the repeat number, the further the platform will go. Both numbers must be the same. Moving.
BlackBerry Game Development Challenges Jeff Bacon, Sr. Smartphone Product Manager Simon Dale, Smartphone Services Team Lead J15.
A good solution to Week 8, Task One Colin Harding (edited by Andrew Williams)
Windows 8 Windows Phone 8 Web Mobile … and WakeUpAndCode.com.
Windows 8 Windows Phone 8 Web Mobile … and WakeUpAndCode.com.
UFCEKU-20-3Web Games Programming Tile-based and Isometric Worlds.
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.
« Philosophy is written in this huge book that I call universe which has always been opened in front of us but we can’t understand it if we first don’t.
1 Scrolling and Panning CIS 487/587 Bruce R. Maxim UM-Dearborn.
Backgrounds, Inheritance in GameMaker (BrickMania 1 of 2) Foundations of Interactive Game Design Professor Jim Whitehead January 28, 2008 Creative Commons.
By Mr. Lee. Backgrounds The image that appears in the background (duh!). This might be a horizon, or clouds, trees and rainbows in the distance If you’re.
Using Tiled. What is Tiled? It’s a level editor It allows game programmers to create their 2D game world with ease.
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.
Number and algebra Shape, space and measures Handling data.
11 Adding Tomato Targets Session Session Overview  We now have a game which lets a player bounce a piece of cheese on a bread bat  Now we have.
Game Maker Terminology
Scale Drawings Pre-GCSE Maths. Aims and Objectives Aims To be able to accurately measure a scale drawing and to calculate real life sizes. (AoN portfolio)
Computer Science 101 Lists and Tables. Lists Unordered lists - use a bullet Ordered lists - use a number, Roman numeral, or letter.
CSE 380 – Computer Game Programming Player Controls & Scrolling Mega Man, by Capcom, released 1988.
CSE 380 – Computer Game Programming Tile Based Graphics & Scrolling Legend of Zelda, by Nintendo, released 1987.
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.
Cascading Style Sheets Positioning Controls Visibility.
Zack Russ.   A simple platform game using pygame.  Player collects jewels and progresses through the levels. A Platformer.
UTILIZING SCRATCH FOR LESSONS. EngagementExplorationExplanation ElaborationEvaluation.
Pac Man Game To make the pac man game. I created sprites for the pac man character so he could move in all directions. I also created sprites for the wall.
Construct 2 Game Development for Kids Platformer Tutorial: Part 1 Shahed Chowdhuri.
A 4.25 kg block of wood has a kinetic coefficient of friction of and a static of between it and the level floor. 0. Calculate the kinetic friction.
Responsive Web Design (RWD) MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/11/2016.
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.
The Stingray Example Program CMT3311. Stingray - an example 2D game May be useful as a simple case study Most 2D games need to solve generic problems.
Chinese Multiplication Also known as: The Gelosia method The Gelosia method The Lattice Method The Lattice Method.
When factoring x^2+bx+c, sometimes there can be many factors of c Example: Factor If you recall, if a =1 then we factor c and we look for the pairs of.
LO: I can multiply using the Grid Method. Please note that this is for 3 Digit Numbers but it still shows how this works. Yr 5’s target is to multiply.
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Object Animation CMT3317. Do you need to do animation? We consider ways of animating composite objects – that have a number of different parts e.g. a.
Susan Ibach | Technical Evangelist Sage Franch | Technical Evangelist.
Index Background Costumes Making object walk smoothly Controlling an object with the keyboard Control an object with the mouse Changing costume when hit.
Today, we'll learn how to animate our artwork
Background Shapes & Collision Resolution (Top-down and Side-scrolling)
Cascading Style Sheets
CS 134 More Graphics.
Dimensional Trivia Clark, Savon White, James Simpson, Sabrina
Continuous Slot Well Screens.
Responsive Web Design (RWD)
Platformer Java Guide by Mr. Monroe.
Chinese Multiplication
BYOB – Costumes.
CSE 381 – Advanced Game Programming Terrain
Responsive Web Design (RWD)
Here.. here. Pardon my "art". Shows how to make a background image Pardon my "art"! Shows how to make a background image. The image.
Areas of the SCRATCH 2 Screen
Cascading Style Sheets
Parallax Shift: May 16, 2005, Period ___ Name _______
2D Terrains.
MTA-4201 Game Programming Chapter 8 : Scrolling Background & Font
Tank Game Int 10 Unit 3 – Game Maker.
The coordinate system Susan Ibach | Technical Evangelist
Chapter 4, Variables Brief Notes
Nate Brunelle Today: Games
Game Programming Algorithms and Techniques
Chapter 13, Math A few Examples.
Goal Space Parts Rules Mechanics Space – Where the game takes place
Positioning Boxes Using CSS
Presentation transcript:

2D Platform Games: Tiles & Scrolling

Platform Games Character jumps from platform to platform World terrain is made of tiles Add player, bad guys, power ups

Creating the game map Make the world (game map) for one level. Don’t use one huge image! Use grid – each slot points to a tile image or null

Issues with Drawing the World Tile world is bigger than screen Need to move the screen (instead of the player, often) Often want background image that moves slower than the rest of the world

Calculate New Position Keep the player in the middle of the screen… Percentage of left and right of screen that makes the scroll happen if (Player.Position.X < marginLeft) cameraMovement = Player.Position.X - marginLeft

Offset Don’t scroll off ends: float maxCameraPosition = Tile.Width * Width – viewport.Width; That is, (the width of one tile * # tiles in a row) – (width of screen) Screen

Drawing the Tiles Efficiency: only draw visible tiles: int left = (int)Math.Floor(cameraPosition/Tile.Width); int right = left + <viewport width>/Tile.Width; right = Math.Min(right, Width-1) // where Width is the width of the 2D table.

Drawing the Sprites Not many – just draw all (brute force) Many – only draw visible sprites Keep sprites in a list ordered by position Partition map into screen – sized portions, keep sprites from each portion

Drawing Backgrounds Choices: Keep background static Scroll background image at same rate as tiles Scroll background image slower to mimic distance Last method is known as Parallax Scrolling

Scrolling Often will have segments of backgrounds. As scrolling happens, rotate backgrounds. Usually no more than 2 backgrounds segments drawn at any given time.