LibGDX. André Restivo 1 / 87
|
|
- James Wilkinson
- 5 years ago
- Views:
Transcription
1 LibGDX André Restivo 1 / 87
2 Index Introduction Core Modules Life-Cycle 2D Graphics Camera Physics Input Handling Scene 2d Collisions Sound Animations Testing 2 / 87
3 Introduction 3 / 87
4 LibGDX A Java game development framework providing a unified API that works across several different platforms: Desktop: Windows, Linux, Mac OS X Mobile: Android, BlackBerry, ios Web: Java Applet, Javascript/WebGL Can be used in many different ways as it does not force a specific design on you. 4 / 87
5 Environment Setup Start by downloading the LibGDX Setup App. To open it, double-click the downloaded.jar file or use java -jar gdx-setup.jar from the command line. If you want to have Android support, you must also have the Android SDK installed. The easiest way is to install Android Studio. 5 / 87
6 Setup App 6 / 87
7 Assets The setup app creates a different project for each selected platform plus a Core project where you will write the bulk of your code. In order to share assets between the different projects, only one assets folder is created. If you select Android as a supported platform, this folder will be located in the Android project. If not, it will be located in the Core project. You might have to change the working directory of each project to the assets folder in your IDE of choice. 7 / 87
8 Core Modules 8 / 87
9 Core Modules The Gdx class provides a unified interface to all the supported platforms: Input - Provides an input model and handler for all platforms (keyboard, touchscreen, accelerometer, mouse,...). Gdx.input.getAccelerometerX() Graphics - Enables the drawing of images to the screen using the hardware provided OpenGL ES implementation. Gdx.graphics.isFullscreen() Gdx.gl.glClearColor(); Files - Abstracts file access on all platforms by providing convenient methods for read/ write operations. Gdx.files.internal() Audio - Facilitates sound recording and playback on all platforms. Gdx.audio.newSound() Networking - Provides methods to perform networking operations, such as simple HTTP get and post requests, and TCP server/client socket communication. Gdx.net.newServerSocket() 9 / 87
10 Core Modules Core modules are not only used by the app being developed, but also by the internal LibGDX code. [Not supported by viewer] upported by viewer] [Not supported by viewer] [Not supported by viewer] [Not supported by viewer] [Not supported by viewer] [Not supported by viewe [Not supported by viewer] 10 / 87
11 Application Life-Cycle 11 / 87
12 Starter Classes For each target platform, a starter class is automatically generated by the setup application. Normally we don't have to modify these classes unless we want to change some configuration items. Example desktop starter class: public class Main { public static void main(string[] args) { LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration(); cfg.title = "My Game"; cfg.usegl30 = false; cfg.width = 480; cfg.height = 320; } } new LwjglApplication(new MyGame(), cfg); 12 / 87
13 ApplicationListener An ApplicationListener allows you to handle application events. This allows you to execute code during certain events within the game life-cycle. public interface ApplicationListener { public void create (); // When the game is created public void render (); // When the game should render a frame public void resize (int width, int height); // When the game is resized public void pause (); // When the game loses focus (android only) public void resume (); // When the game regains focus (android only) public void dispose (); // When the games is closed } 13 / 87
14 Life Cycle Application Start create() resize() resume() Regained Focus<div>(android)</div> render() Application Running [Not supported by viewer] pause() Application Closing pause() dispose() Application Stop 14 / 87
15 ApplicationAdapter An abstract class that implements the ApplicationListener interface. Allows the developer to implement the ApplicationListener interface without overriding every method. public abstract class ApplicationAdapter implements ApplicationListener { } /*... */ 15 / 87
16 Game A Game is an ApplicationListener that supports multiple screens. You can create multiple screens and switch between them using setscreen. Game events are delegated to the current screen. public abstract class Game implements ApplicationListener { } public void setscreen(screen screen); public Screen getscreen(); /*... */ 16 / 87
17 Screen Represents one of many application screens, such as a main menu, a settings menu, the game screen and so on. public interface Screen { public void public void public void public void public void public void public void dispose(); hide(); pause(); render(float delta); // delta in seconds since the last render. resize(int width, int height); resume(); show(); } 17 / 87
18 ScreenAdapter An abstract class that implements the Screen interface. Allows the developer to implement the Screen interface without overriding every method. public abstract class ScreenAdapter implements Screen { } /*... */ 18 / 87
19 Proposed Usage «interface»<div>applicationlistener</div> [Not supported by viewer] + create() : void + pause() : void + dispose() : void + render() : void + resize(int width, int height) : void + resume() : void [Not supported by viewer] + setscreen(screen screen) : void + getscreen() : Screen * + dispose() + hide() + pause() + render(float delta) + resize(int width, int height) + resume() + show() «abstract»<div>applicationadapter</div> [Not supported by viewer] <div>mygame</div> <div>mainmenuscreen</div> <div>gamescreen</div> Our Game Classes 19 / 87
20 2D Graphics 20 / 87
21 SpriteBatch It is very common to draw a texture mapped to rectangular geometry. It is also very common to draw the same texture or various regions of that texture many times. It would be inefficient to send each rectangle one at a time to the GPU to be drawn. Instead, many rectangles for the same texture can be described and sent to the GPU all at once. This is what the SpriteBatch class does. public class SpriteBatch implements Batch { public void begin (); public void draw(texture texture, float x, float y); // and many other like this public void end(); public void dispose(); } 21 / 87
22 Texture The Texture class decodes an image file and loads it into GPU memory. public class Texture extends GLTexture { } Loading a texture into memory: Texture herotexture = new Texture (Gdx.files.internal("hero.png")); Textures should be disposed once they are not needed: herotexture.dispose(); 22 / 87
23 TextureRegion The TextureRegion class describes a rectangle inside a texture and is useful for drawing only a portion of the texture. public class TextureRegion { public TextureRegion (TextureRegion region, int x, int y, int width, int height); public void setregion (int x, int y, int width, int height); } public static TextureRegion[][] split (Texture texture, int tilewidth, int tileheight); The split method is an helper method that splits a Texture into TextureRegions according to a tile width and height. 23 / 87
24 Sprite The Sprite class describes both a texture region and the geometry where it will be drawn. public class Sprite extends TextureRegion { public Sprite (TextureRegion region); public void setposition (float x, float y); public void setcenter(float x, float y); public void setrotation (float degrees); public void setscale (float scalexy); } public void draw (Batch batch); 24 / 87
25 Texture Classes GLTexture [Not supported by viewer] Texture 1 TextureRegion Sprite 25 / 87
26 AssetManager Textures take a lot of precious memory. The same texture is typically used more than once. The AssetManager can manage our textures keeping only one copy of each in memory. It also handles asynchronous loading. public class AssetManager implements Disposable { public <T> void load (String filename, Class<T> type); public <T> T get (String filename); } public boolean update(); // true if finished loading public void finishloading (); // waits for all assets to load 26 / 87
27 Render To render our Screen we can do something like: // In our screen class: public void render(float delta) { super.render(delta); // Clear the screen Gdx.gl.glClearColor( 103/255f, 69/255f, 117/255f, 1 ); Gdx.gl.glClear( GL20.GL_COLOR_BUFFER_BIT GL20.GL_DEPTH_BUFFER_BIT ); } // Draw the texture game.getbatch().begin(); game.getbatch().draw(texture, 100, 100); game.getbatch().end(); Delta is the time in seconds since the last render. 27 / 87
28 Example As an example lets checkout the texture branch on this example project: In particular the BouncingScreen class. 28 / 87
29 Camera 29 / 87
30 Units Every device has a different screen size and ratio. This means that we cannot think in terms of pixels to define the size of our objects. A sugestion for dealing with this problem: public static int WORLD_WIDTH = 100; // Arbitrary world size (e.g. meters) public static int WORLD_HEIGHT = 50; // The ammount of world we want to show in our screen public static int VIEWPORT_WIDTH = 50; public static int VIEWPORT_HEIGHT = 25; // Can be calculated from screen ratio // How to transform from pixels to our unit public static int PIXEL_TO_METER =.05f; float ratio = ((float)gdx.graphics.getheight() / (float)gdx.graphics.getwidth()); 30 / 87
31 Example For example: A world of 100x50(m). On a 1280x720(px) screen. With a viewport 50m wide. And showing a 50x50(px) texture. Where a pixel is equal to.05m. We would get: The world would have 2560x2048 pixels. The screen ratio would be The viewport would be 1280x720(px) or 50x28.1(m). The texture would represent 2.5x2.5(m). The texture would be drawn as 64x64(px) (2.5/50*1280). 31 / 87
32 Orthographic Camera The viewport into our game. Implements a parallel (orthographic) projection. public class OrthographicCamera extends Camera { public OrthographicCamera (float viewportwidth, float viewportheight); public void update (); // Updates the transformation matrix } Setting the camera position: camera.position.set(new Vector3(x, y, 0)); 32 / 87
33 Example As an example lets checkout the camera branch on this example project: In particular the BouncingScreen class. 33 / 87
34 Physics 34 / 87
35 World The World class manages all physics entities using Box2D. public final class World implements Disposable { public World (Vector2 gravity, boolean dosleep); public Body createbody (BodyDef def); public void destroybody (Body body); } The world uses SI units (meters, Newtons, seconds, radians,...) 35 / 87
36 Body In Box2D the physical objects are called bodies. Bodies can be of three types: Dynamic: move around and are affected by forces and other dynamic, kinematic and static objects (example: hero, enemies,...). Static: do not move and are not affected by forces (but affect dynamic objects (examples: ground, platform, wall,...). Kinematic: do not react to forces, but have the ability to move (example: a moving plaform). 36 / 87
37 Body Definition To create a body we first must create a body definition. A body definition holds all the data needed to construct a rigid body. You can safely re-use body definitions. BodyDef bodydef = new BodyDef(); bodydef.type = BodyDef.BodyType.DynamicBody; bodydef.angle = (float) (Math.PI / 4); // radians bodydef.position.set(10f, 5f); // meters bodydef.linearvelocity.set(5f, 0f); // meters/s bodydef.angularvelocity.set(math.pi); // PI radians/s Body body = world.createbody(bodydef); 37 / 87
38 Fixtures Each body is made up of one or more fixtures, which have a fixed position and orientation within the body. Fixtures give bodies their shape, mass and properties. // Create shape CircleShape circle = new CircleShape(); circle.setradius(0.22f); //22cm // Create fixture FixtureDef fixturedef = new FixtureDef(); fixturedef.shape = circle; fixturedef.density =.5f; // how heavy is the fixture kg/m^2 fixturedef.friction =.5f; // how slippery is the fixture [0,1] fixturedef.restitution =.5f; // how bouncy is the fixture [0,1] // Attach ficture to body body.createfixture(fixturedef); 38 / 87
39 Shapes There are 4 types of shapes that can be used to create fixtures: Circle: A circle with a radius. Edge: A line segment. Chain: A chain of line segments. Polygon: A convex polygon. 39 / 87
40 Circle Shape Circles have a radius: CircleShape circle = new CircleShape(); circle.setradius(0.11f); 40 / 87
41 Polygon Shape Polygon shapes must be convex and can have 8 vertexes at most. They can be combined to create more complex shapes. public class PolygonShape extends Shape { public void set (Vector2[] vertices); } Creating a rectangular shape is easy with the setasbox method. PolygonShape rectangle = new PolygonShape(); rectangle.setasbox(1f, 0.5f); 41 / 87
42 Updating the world To update our simulation we need to tell our world to step. Stepping updates the world objects through time. The best place to call our step function is at the end of our render loop. public final class World implements Disposable { public void step ( float timestep, // time since last update int velocityiterations, // accuracy for velocity constraints (6) int positioniterations); // accuracy for position constraints (2) } 42 / 87
43 Example As an example lets checkout the physics and ground branches on this example project: In particular the BouncingScreen (physics) and BouncingScreen (ground) classes. 43 / 87
44 Direct Movement We can change the position, angle and speed of a body directly: public void settransform (Vector2 position, float angle); // meters, radians public void setlinearvelocity (Vector2 velocity); // meters/second public void setangularvelocity (float omega); // radians/second 44 / 87
45 Forces and Impulses But normally, to move things around, we will apply forces or impulses to a body. Forces act gradually over time to change the velocity of a body. Impulses change a body's velocity immediately. public class Body { public void applyforce (Vector2 force, Vector2 point, boolean wake); // Newtons public void applyforcetocenter (Vector2 force, boolean wake); // Newtons public void applylinearimpulse (Vector2 impulse, Vector2 point, boolean wake); //Newtons*second } 45 / 87
46 Torque Angular movement can also be controlled: Torques act gradually over time to change the angular velocity of a body. Impulses change a body's angular velocity immediately. public class Body { public void applytorque (float torque, boolean wake); //Newton*meter public void applyangularimpulse (float impulse, boolean wake); //kg*m²/second } More on Box2D 46 / 87
47 Input Handling 47 / 87
48 Keyboard In each step of our simulation we can check if some key of the keyboard has been pressed using the Input interface. public interface Input { public boolean iskeypressed (int key); public boolean iskeyjustpressed (int key); } The Input interface also has keycodes for every key: Input.isKeyPressed( Input.Key.NUM_0 ); Input.isKeyPressed( Input.Key.A ); Input.isKeyPressed( Input.Key.LEFT ); /*... */ 48 / 87
49 Touch We can also checked if the screen has been touched or clicked: public interface Input { public boolean istouched (); public boolean justtouched (); } And get the touch coordinates: public interface Input { public int getx (); public int gety (); public int getdeltax (); public int getdeltay (); } 49 / 87
50 Example As an example lets checkout the input branch on this example project: In particular the BouncingScreen class. 50 / 87
51 Scene2d 51 / 87
52 Scene2d Scene2d is a 2D scene graph for building applications and UIs using a hierarchy of actors: Rotation and scale is applied to all child actors. Each actor draws in its own un-rotated and unscaled coordinate system where 0,0 is the bottom left corner. Hit (touch, mouse) detection of rotated and scaled actors. Routing of input and other events to the appropriate actor. Action system for easy manipulation of actors over time. 52 / 87
53 Stage The Stage class has a camera, SpriteBatch, and a root group and handles drawing the actors and distributing input events. public class Stage extends InputAdapter implements Disposable { public Stage (Viewport viewport); public void act (float delta); public void draw (); } 53 / 87
54 Viewport Manages a Camera and determines how world coordinates are mapped to and from the screen. Many types of viewports can be used: StretchViewport FitViewport FillViewport ScreenViewport 54 / 87
55 StrechViewport The StretchViewport supports working with a virtual screen size. The virtual viewport will always be stretched to fit the screen. No black bars, but the aspect ratio may not be the same. [Not supported by viewer] [Not supported by viewer] [Not supported [Not supported by view by 55 / 87
56 FitViewport The FitViewport supports working with a virtual screen size. It will always maintain the aspect ratio of the virtual screen size, while scaling it as much as possible to fit the screen. One disadvantage with this strategy is that there may appear black bars. [Not supported by viewer] [Not supported by v [Not supported by viewer] [Not supported by 56 / 87
57 FillViewport The FillViewport supports working with a virtual screen size. Keeps the aspect ratio of the virtual screen size. It will always fill the whole screen. Parts of the viewport might be cut off. [Not supported by viewer] [Not supported by viewer] [Not supported [Not by supported viewer] by v 57 / 87
58 ScreenViewport The ScreenViewport does not have a constant virtual screen size. It will always match the window size. No scaling happens and no black bars appear. A player with a bigger screen might see more of the game, than a player with a smaller screen size. [Not supported by viewer] [Not supported by viewer] 58 / 87
59 Actor The Actor class is a node in the graph which has a position, rectangular size, origin, scale, rotation, and color. public class Actor { public void draw (Batch batch, float parentalpha); public void act (float delta); protected void setstage (Stage stage); } 59 / 87
60 Group The Group class is an actor that may have child actors. public class Group extends Actor { public void addactor (Actor actor); public boolean removeactor (Actor actor); } 60 / 87
61 Widgets LibGDX has a set of predefined actors ready to be used: Image - An image Label - A text label List - A list of textual items with current selection support ProgressBar - The progress of some activity or a value within a range SelectBox - A dropdown list TextField - A single-line input field Touchpad - A virtual joystick scorelabel = new Label("0", new Label.LabelStyle(new BitmapFont(), null)); scorelabel.setcolor(color.white); addactor(scorelabel); 61 / 87
62 Usage initial:screen :Viewport :World :Game game:stage ball:actor game:screen hud:stage ground:actor :Viewport score:actor 62 / 87
63 Events Stage is an InputProcessor. When it receives input events, it fires them on the appropriate actors. Events are propagated in two phases: The capture phase from the root down to the target actor. And the normal phase from the target up to the root. public class Actor { public boolean addlistener (EventListener listener); public boolean removelistener (EventListener listener); public void settouchable (Touchable touchable); public void setvisible (boolean visible); } 63 / 87
64 ClickListener Listens to mouse and touch events. public ClickListener () { public void touchdown(inputevent e, float x, float y, int pointer, int button); public void touchup(inputevent e, float x, float y, int pointer, int button); public void clicked(inputevent e, float x, float y); } public int gettapcount(); 64 / 87
65 ActorGestureListener For more complex touch events. public ActorGestureListener () { public void touchdown(inputevent e, float x, float y, int pointer, int button); public void touchup(inputevent e, float x, float y, int pointer, int button); public void tap(inputevent e, float x, float y, int count, int button); public boolean longpress(actor actor, float x, float y); public void fling(inputevent e, float velocityx, float velocityy, int button); public void pan(inputevent e, float x, float y, float deltax, float deltay); public void zoom(inputevent e, float initialdistance, float distance); public void pinch(inputevent e, Vector2 ipointer1, Vector2 ipointer2, Vector2 pointer1, Vector2 pointer2); } 65 / 87
66 Example As an example lets checkout the stage branch on this example project: In particular the BouncingScreen, GameStage, BallActor and GroundActor classes. 66 / 87
67 Actions Actions can be attached to actors in order to execute a certain operation on the actor for a certain time. When a action finishes, the action is automatically removed from the actor. abstract public class Action { abstract public boolean act (float delta); } Many actions are already implemented in libgdx but more can be added easily: MoveToAction action = new MoveToAction(); action.setposition(x, y); action.setduration(duration); actor.addaction(action); Actions can be composed together to create more complex actions. 67 / 87
68 Example As an example lets checkout the action branch on this example project: In particular the GameStage and BallActor classes. 68 / 87
69 Collisions 69 / 87
70 Collisions To detect collisions between body in the physical world we can implement a ContactListener interface: public interface ContactListener { public void begincontact (Contact contact); public void endcontact (Contact contact); } To use it, just set and implement the contact listener of the physical world: world.setcontactlistener(new ContactListener() public void begincontact(contact contact) { } public void endcontact(contact contact) { } 70 / 87
71 Contact When a collision is detected, the ContactListener receives a Contact class with information about the contact. We can easily get the fixtures that collided: public class Contact { public Fixture getfixturea (); public Fixture getfixtureb (); } And also the bodies: world.setcontactlistener(new ContactListener() public void begincontact(contact contact) { Body bodya = contact.getfixturea().getbody(); Body bodyb = contact.getfixtureb().getbody(); } } The order of the fixtures (and bodies) is not guaranteed! 71 / 87
72 Body User Data User data can be attached to a body to help identify the colliding bodies: public class Body { public Object getuserdata (); public void setuserdata (Object userdata); } For example: body.setuserdata(actor); And then: Actor actor = (Actor)body.getUserData(); 72 / 87
73 Example As an example lets checkout the collision branch on this example project: In particular the GameStage class. 73 / 87
74 Sound 74 / 87
75 Sound LibGDX supports two main types of sound: Music: represents a streamed audio file. The interface supports pausing, resuming and so on. Sound a short audio clip that can be played numerous times in parallel. Sound sound = Gdx.audio.newSound(Gdx.files.internal("kick.wav")); Music music = Gdx.audio.newMusic(Gdx.files.internal("music.mp3")); All sounds and musics should be disposed when no longer needed: sound.dispose(); music.dispose(); 75 / 87
76 Sound Manager We can use the AssetManager to manage our sounds and musics just like we do with textures: assetmanager.load("kick.wav", Sound.class); assetmanager.load("music.mp3", Music.class); And then: Sound sound = assetmanager.get("kick.wav"); Music music = assetmanager.get("music.mp3"); 76 / 87
77 Playing To play a sound we can use public interface Sound extends Disposable { public long play (); public long play (float volume); // Volume = [0,1] } To play a music: public interface Music extends Disposable { public void setvolume (float volume); public void setlooping (boolean islooping); public void play (); public void pause (); public void stop (); } public boolean isplaying (); 77 / 87
78 Animations 78 / 87
79 Animation An animation consists of multiple frames which are shown in a sequence at set intervals. To create a animation we start by getting a texture and spliting it into TextureRegions: Texture texture = game.getassetmanager().get("animation.png TextureRegion[][] thrustregion = TextureRegion.split( texture, texture.getwidth() / 5, // 5 columns texture.getheight() / 3); // 3 lines 79 / 87
80 Frames We then need to transform the resulting bi-dimensional array into a uni-dimensional array. The easiest way to do it, is to use the System.arraycopy method: public static void arraycopy( Object src, int srcpos, Object dest, int destpos, int length); Like this: TextureRegion[] frames = new TextureRegion[10]; System.arraycopy(thrustRegion[0], 0, frames, 0, 10); 80 / 87
81 Current Frame We then create the animation: // 0.25 seconds per frame Animation animation = new Animation<TextureRegion>(.25f, frames); The current frame is a TextureRegion and we can get it like this: public class Animation { public TextureRegion getkeyframe ( float statetime, // current time boolean looping // should the animation loop ); } 81 / 87
82 Example As an example lets checkout the animation branch on this example project: In particular the BallActor class. 82 / 87
83 Testing 83 / 87
84 Testing LigGDX promotes the mixing of the graphical interface with the model and logic rules of the game. This makes testing harder: Because our classes start by loading their textures, a OpenGL driver must be in use, which may not be possible. A world must be created if physics is being used. Testing units separately is difficult. 84 / 87
85 Model-View-Controller A better way to organize our code is to use the high-level archictural design pattern known as Model-View-Controller (MVC): Controller updates events updates notifies View Model 85 / 87
86 Proposed Architecture The MVC pattern is more suited for gui-driven applications than to games, that normally use a render-loop pattern. For these we propose a slightly different approach: [Not supported by viewer] updates events updates Screen reads Model Screen reads Model 86 / 87
87 Example As an example lets checkout the sprites and physics branch on this example project: / 87
Game Programming with. presented by Nathan Baur
Game Programming with presented by Nathan Baur What is libgdx? Free, open source cross-platform game library Supports Desktop, Android, HTML5, and experimental ios support available with MonoTouch license
More informationComputer Games 2014 Selected Game Engines
Computer Games 2014 Selected Game Engines Dr. Mathias Lux Klagenfurt University This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 pixi.js Web based rendering engine
More informationComputer Games 2011 Selected Game Engines
Computer Games 2011 Selected Game Engines Dr. Mathias Lux Klagenfurt University This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 libgdx features High-performance,
More informationLibGDX Notes. Using BlueJ. LibGDX Notes
LibGDX Notes These notes assume that you have a familiarity with Java programming. If you do program in Java you probably use an integrated development environment (IDE) already. There are many possible
More informationMultimedia-Programmierung Übung 7
Multimedia-Programmierung Übung 7 Ludwig-Maximilians-Universität München Sommersemester 2017 Today Particles Sound Illustrated with + Physics Users have specific expectations For example, if something
More information8 Physics Simulations
8 Physics Simulations 8.1 Billiard-Game Physics 8.2 Game Physics Engines Literature: cocos2d-x.org R. Engelbert: Cocos2d-x Beginner's Guide, 2nd ed., Packt Publishing 2015 1 Particle Animations Animation
More informationGraphics with libgdx
Graphics with libgdx Dr. Andrew Vardy Adapted from the following sources: libgdx slides by Jussi Pohjolainen (Tampere Unversity of Applied Sciences) transformation slides by Dr. Paul Gillard (Memorial
More informationUI Elements. If you are not working in 2D mode, you need to change the texture type to Sprite (2D and UI)
UI Elements 1 2D Sprites If you are not working in 2D mode, you need to change the texture type to Sprite (2D and UI) Change Sprite Mode based on how many images are contained in your texture If you are
More informationIntroduction to Unreal Engine Blueprints for Beginners. By Chaven R Yenketswamy
Introduction to Unreal Engine Blueprints for Beginners By Chaven R Yenketswamy Introduction My first two tutorials covered creating and painting 3D objects for inclusion in your Unreal Project. In this
More informationthe gamedesigninitiative at cornell university Lecture 12 Scene Graphs
Lecture 12 Aside: When Do We Load Assets? Main Application Application Start-up Level Load GameMode GameMode Models Scene Choice affects design Models Scene & ownership of asset manager 2 Drawing in CUGL
More informationthe gamedesigninitiative at cornell university Lecture 6 Scene Graphs
Lecture 6 Structure of a CUGL Application Main Application Scene Scene Models Root Models Root 2 Structure of a CUGL Application Main App Configuration Application Memory policy (future lecture) Scene
More informationPong in Unity a basic Intro
This tutorial recreates the classic game Pong, for those unfamiliar with the game, shame on you what have you been doing, living under a rock?! Go google it. Go on. For those that now know the game, this
More informationReactPhysics3D library User Manual
ReactPhysics3D library User Manual Version: 0.7.0 Daniel Chappuis http://www.reactphysics3d.com April 30, 2018 Contents 1 Introduction 5 2 Features 5 3 License 5 4 Building the library 6 4.1 CMake using
More informationPlatform Games Drawing Sprites & Detecting Collisions
Platform Games Drawing Sprites & Detecting Collisions Computer Games Development David Cairns Contents Drawing Sprites Collision Detection Animation Loop Introduction 1 Background Image - Parallax Scrolling
More informationReal-Time Physics Simulation. Alan Hazelden.
Real-Time Physics Simulation Alan Hazelden alan@draknek.org http://www.draknek.org/ Who am I? Studied Computer Science 2005-2009 Warwick Game Design exec member 3rd and 4th year projects: physics engines
More informationMobile Touch Floating Joysticks with Options version 1.1 (Unity Asset Store) by Kevin Blake
Mobile Touch Floating Joysticks with Options version 1.1 (Unity Asset Store) by Kevin Blake Change in version 1.1 of this document: only 2 changes to this document (the unity asset store item has not changed)
More informationInteractive OpenGL Animation
Syracuse University SURFACE Syracuse University Honors Program Capstone Projects Syracuse University Honors Program Capstone Projects Spring 5-1-2011 Interactive OpenGL Animation Lusha Zhang Follow this
More information: Rendered background can show navigation mesh : Multi-level backgrounds, priority backgrounds and Z-ordering.
Update history: 2017-04-13: Initial release on Marketplace for UE4.15. 2017-05-09: Rendered background can show navigation mesh. 2017-05-19: Multi-level backgrounds, priority backgrounds and Z-ordering.
More informationUnity Game Development
Unity Game Development 1. Introduction to Unity Getting to Know the Unity Editor The Project Dialog The Unity Interface The Project View The Hierarchy View The Inspector View The Scene View The Game View
More informationComputer Games 2012 Game Development
Computer Games 2012 Game Development Dr. Mathias Lux Klagenfurt University This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 libgdx features High-performance, cross-platform
More informationPrinciples of Computer Game Design and Implementation. Lecture 5
Principles of Computer Game Design and Implementation Lecture 5 We already knew Introduction to this module History of video High-level information of a game Designing information for a game Execution
More informationBurning Laser. In this tutorial we are going to use particle flow to create a laser beam that shoots off sparks and leaves a burn mark on a surface!
Burning Laser In this tutorial we are going to use particle flow to create a laser beam that shoots off sparks and leaves a burn mark on a surface! In order to save time on things you should already know
More informationEasy Decal Version Easy Decal. Operation Manual. &u - Assets
Easy Decal Operation Manual 1 All information provided in this document is subject to change without notice and does not represent a commitment on the part of &U ASSETS. The software described by this
More informationComputer Science 474 Spring 2010 Viewing Transformation
Viewing Transformation Previous readings have described how to transform objects from one position and orientation to another. One application for such transformations is to create complex models from
More informationCOMP3421 Computer Graphics
COMP3421 Computer Graphics Introduction Angela Finlayson Email: angf@cse.unsw.edu.au Computer Graphics Algorithms to automatically render images from models. Light Camera hi mum Objects model image Computer
More informationNot For Sale. Glossary
Glossary Actor A sprite and the role it plays as it interacts with another sprite on the stage. Animated GIF A graphic made up of two or more frames, each of which is displayed as an automated sequence
More informationCS 160: Interactive Programming
CS 160: Interactive Programming Professor John Canny 3/8/2006 1 Outline Callbacks and Delegates Multi-threaded programming Model-view controller 3/8/2006 2 Callbacks Your code Myclass data method1 method2
More informationAndroid and OpenGL. Android Smartphone Programming. Matthias Keil. University of Freiburg
Android and OpenGL Android Smartphone Programming Matthias Keil Institute for Computer Science Faculty of Engineering 1. Februar 2016 Outline 1 OpenGL Introduction 2 Displaying Graphics 3 Interaction 4
More informationANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL II)
ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL II) Media Playback Engine Android provides a media playback engine at the native level called Stagefright that comes built-in with software-based
More information+ Inheritance. Sometimes we need to create new more specialized types that are similar to types we have already created.
+ Inheritance + Inheritance Classes that we design in Java can be used to model some concept in our program. For example: Pokemon a = new Pokemon(); Pokemon b = new Pokemon() Sometimes we need to create
More informationthe gamedesigninitiative at cornell university Lecture 14 2D Sprite Graphics
Lecture 14 Drawing Images Graphics Lectures SpriteBatch interface Coordinates and Transforms Drawing Perspective Camera Projections Drawing Primitives Color and Textures Polygons 2 Drawing Images Graphics
More informationGame Board: Enabling Simple Games in TouchDevelop
Game Board: Enabling Simple Games in TouchDevelop Manuel Fähndrich Microsoft Research One Microsoft Way, Redmond WA 98052, USA maf@microsoft.com February 23, 2012 Abstract TouchDevelop is a novel application
More informationEvent-driven Programming: GUIs
Dr. Sarah Abraham University of Texas at Austin Computer Science Department Event-driven Programming: GUIs Elements of Graphics CS324e Spring 2018 Event-driven Programming Programming model where code
More informationData Management CS 4720 Mobile Application Development
Data Management Mobile Application Development Desktop Applications What are some common applications you use day-to-day? Browser (Chrome, Firefox, Safari, etc.) Music Player (Spotify, itunes, etc.) Office
More informationCS1950U Setup Spring 2018
CS1950U Topics in 3D Game Engine Development Barbara Meier CS1950U Setup Spring 2018 Introduction Hi there! This guide is designed to help you get setup for taking CS1950U. It will go through the basics
More informationmove object resize object create a sphere create light source camera left view camera view animation tracks
Computer Graphics & Animation: CS Day @ SIUC This session explores computer graphics and animation using software that will let you create, display and animate 3D Objects. Basically we will create a 3
More information(C) 2010 Pearson Education, Inc. All rights reserved. Omer Boyaci
Omer Boyaci A sprite must monitor the game environment, for example, reacting to collisions with different sprites or stopping when it encounters an obstacle. Collision processing can be split into two
More information[ the academy_of_code] Senior Beginners
[ the academy_of_code] Senior Beginners 1 Drawing Circles First step open Processing Open Processing by clicking on the Processing icon (that s the white P on the blue background your teacher will tell
More informationGenerating Vectors Overview
Generating Vectors Overview Vectors are mathematically defined shapes consisting of a series of points (nodes), which are connected by lines, arcs or curves (spans) to form the overall shape. Vectors can
More informationGOM Cam User Guide. Please visit our website (cam.gomlab.com) regularly to check out our. latest update.
GOM Cam User Guide Please visit our website (cam.gomlab.com) regularly to check out our latest update. From screen recording to webcam video and gameplay recording GOM Cam allows you to record anything
More informationCiril Bohak. - INTRODUCTION TO WEBGL
2016 Ciril Bohak ciril.bohak@fri.uni-lj.si - INTRODUCTION TO WEBGL What is WebGL? WebGL (Web Graphics Library) is an implementation of OpenGL interface for cmmunication with graphical hardware, intended
More informationIndex. Angry Birds, 19
Index A Angry Birds, 19 B Box2D engine, 39 animation constraint solver, 45 integrator, 45 updated init() function, 46 world.clearforces() function, 45 world.drawdebugdata() function, 45 world.step() function,
More informationAN INTRODUCTION TO SCRATCH (2) PROGRAMMING
AN INTRODUCTION TO SCRATCH (2) PROGRAMMING Document Version 2 (04/10/2014) INTRODUCTION SCRATCH is a visual programming environment and language. It was launched by the MIT Media Lab in 2007 in an effort
More informationDeveloping Applications for ios
Developing Applications for ios Lecture 1: Mobile Applications Development Radu Ionescu raducu.ionescu@gmail.com Faculty of Mathematics and Computer Science University of Bucharest Evaluation Individual
More informationHow to create shapes. Drawing basic shapes. Adobe Photoshop Elements 8 guide
How to create shapes With the shape tools in Adobe Photoshop Elements, you can draw perfect geometric shapes, regardless of your artistic ability or illustration experience. The first step to drawing shapes
More informationViewport 2.0 API Porting Guide for Locators
Viewport 2.0 API Porting Guide for Locators Introduction This document analyzes the choices for porting plug-in locators (MPxLocatorNode) to Viewport 2.0 mostly based on the following factors. Portability:
More informationBlender Notes. Introduction to Digital Modelling and Animation in Design Blender Tutorial - week 1 The Blender Interface and Basic Shapes
Blender Notes Introduction to Digital Modelling and Animation in Design Blender Tutorial - week 1 The Blender Interface and Basic Shapes Introduction Blender is a powerful modeling, animation and rendering
More informationBaking Blender materials to texture to make them usable in a game engine
Baking Blender materials to texture to make them usable in a game engine Categories : Uncategorised Date : 19th November 2017 1 / 20 Baking Blender materials to texture to make them usable in a game engine
More informationIndex. Aditya Ravi Shankar 2017 A. R. Shankar, Pro HTML5 Games, DOI /
Index A Accidental scrolling, 132 Angry Birds, 21 Animation, 18 clearinterval() method, 18 drawingloop() method, 18 requestanimationframe() method, 19 setinterval() method, 18 AStar() method, 230 Audio
More informationChapter 19- Object Physics
Chapter 19- Object Physics Flowing water, fabric, things falling, and even a bouncing ball can be difficult to animate realistically using techniques we have already discussed. This is where Blender's
More informationIntroduction to OpenGL. CS 4620 Balazs Kovacs, 2014 Daniel Schroeder, 2013 Pramook Khungurn, 2012
Introduction to OpenGL CS 4620 Balazs Kovacs, 2014 Daniel Schroeder, 2013 Pramook Khungurn, 2012 Introduction Show how to produce graphics using OpenGL Introduce our framework for OpenGL programming OpenGL
More informationMemory Management: High-Level Overview
Lecture 9 : High-Level Overview Gaming Memory (Last Generation) Playstation 3 256 MB RAM for system 256 MB for graphics card X-Box 360 512 MB RAM (unified) Nintendo Wii 88 MB RAM (unified) 24 MB for graphics
More informationUser Interaction. User Interaction. Input devices. Input devices. Input devices GUIs and GUI design Event-driven programming 3D interaction
User Interaction User Interaction Input devices GUIs and GUI design Event-driven programming 3D interaction CS 465 lecture 19 2003 Steve Marschner 1 2003 Steve Marschner 2 Input devices Input devices Discrete
More informationSparklet Embedded GUI Library User Manual
1 E M B I E N T E C H N O L O G I E S Sparklet Embedded GUI Library User Manual Embien Technologies No 3, Sankarapandian Street, Madurai, India 625017 www.embien.com 2 3 Table of Contents 1 Introduction...
More informationComputer Games Development Spring Practical 3 GameCore, Transforms & Collision Detection
In this practical we are going to look at the GameCore class in some detail and then move on to examine the use of transforms, collision detection and tile maps. Combined with the material concerning sounds
More informationDanmaku Mono Documentation
Danmaku Mono Documentation Release 0.01b UltimaOmega February 21, 2017 Miscellaneous Functions 1 Miscellaneous Functions 3 1.1 GetKeyState(keytocheck)........................................ 3 1.2 SetKeyState(key,
More information521493S Computer Graphics Exercise 1 (Chapters 1-3)
521493S Computer Graphics Exercise 1 (Chapters 1-3) 1. Consider the clipping of a line segment defined by the latter s two endpoints (x 1, y 1 ) and (x 2, y 2 ) in two dimensions against a rectangular
More informationArcGIS Runtime: Maximizing Performance of Your Apps. Will Jarvis and Ralf Gottschalk
ArcGIS Runtime: Maximizing Performance of Your Apps Will Jarvis and Ralf Gottschalk Agenda ArcGIS Runtime Version 100.0 Architecture How do we measure performance? We will use our internal Runtime Core
More informationCreating joints for the NovodeX MAX exporter
Creating joints for the NovodeX MAX exporter (a step-by-step tutorial by Pierre Terdiman) p.terdiman@wanadoo.fr Version 0.3 I) Creating a hinge Here we'll see how to create a hinge joint compatible with
More informationINTRODUCTION TO ANDROID
INTRODUCTION TO ANDROID 1 Niv Voskoboynik Ben-Gurion University Electrical and Computer Engineering Advanced computer lab 2015 2 Contents Introduction Prior learning Download and install Thread Android
More informationANIMATOR TIMELINE EDITOR FOR UNITY
ANIMATOR Thanks for purchasing! This document contains a how-to guide and general information to help you get the most out of this product. Look here first for answers and to get started. What s New? v1.53
More informationINTRO TO COCOS2D. 360iDev 2011
INTRO TO COCOS2D 360iDev 2011 ABOUT US Ray: @rwenderlich Rod: @rodstrougo Founder of Razeware www.razeware.com Founder of Prop Group www.prop.gr Writes ios tutorials at www.raywenderlich.com 6 apps in
More informationCS 465 Program 4: Modeller
CS 465 Program 4: Modeller out: 30 October 2004 due: 16 November 2004 1 Introduction In this assignment you will work on a simple 3D modelling system that uses simple primitives and curved surfaces organized
More informationHow to draw and create shapes
Adobe Flash Professional Guide How to draw and create shapes You can add artwork to your Adobe Flash Professional documents in two ways: You can import images or draw original artwork in Flash by using
More informationParticle systems, collision detection, and ray tracing. Computer Graphics CSE 167 Lecture 17
Particle systems, collision detection, and ray tracing Computer Graphics CSE 167 Lecture 17 CSE 167: Computer graphics Particle systems Collision detection Ray tracing CSE 167, Winter 2018 2 Particle systems
More informationUser InterfaceChapter1:
Chapter 1 User InterfaceChapter1: In this chapter you will learn about several aspects of the User Interface. You will learn about the overall layout of the UI, and then about the details of each element.
More informationJavaFX Technology Building GUI Applications With JavaFX - Tutorial Overview
avafx Tutorial Develop Applications for Desktop and Mobile Java FX 2/10/09 3:35 PM Sun Java Solaris Communities My SDN Account Join SDN SDN Home > Java Technology > JavaFX Technology > JavaFX Technology
More informationCS Exam 1 Review Problems Fall 2017
CS 45500 Exam 1 Review Problems Fall 2017 1. What is a FrameBuffer data structure? What does it contain? What does it represent? How is it used in a graphics rendering pipeline? 2. What is a Scene data
More informationmgwt Cross platform development with Java
mgwt Cross platform development with Java Katharina Fahnenbruck Consultant & Trainer! www.m-gwt.com Motivation Going native Good performance Going native Good performance Device features Going native Good
More informationCMSC427 Transformations II: Viewing. Credit: some slides from Dr. Zwicker
CMSC427 Transformations II: Viewing Credit: some slides from Dr. Zwicker What next? GIVEN THE TOOLS OF The standard rigid and affine transformations Their representation with matrices and homogeneous coordinates
More informationWindows and Events. created originally by Brian Bailey
Windows and Events created originally by Brian Bailey Announcements Review next time Midterm next Friday UI Architecture Applications UI Builders and Runtimes Frameworks Toolkits Windowing System Operating
More informationAsteroid Destroyer How it Works
Asteroid Destroyer How it Works This is a summary of some of the more advance coding associated with the Asteroid Destroyer Game. Many of the events with in the game are common sense other than the following
More informationPacman. you want to see how the maze was created, open the file named unity_pacman_create_maze.
Pacman Note: I have started this exercise for you so you do not have to make all of the box colliders. If you want to see how the maze was created, open the file named unity_pacman_create_maze. Adding
More informationCS4621/5621 Fall Computer Graphics Practicum Intro to OpenGL/GLSL
CS4621/5621 Fall 2015 Computer Graphics Practicum Intro to OpenGL/GLSL Professor: Kavita Bala Instructor: Nicolas Savva with slides from Balazs Kovacs, Eston Schweickart, Daniel Schroeder, Jiang Huang
More informationThe Application Stage. The Game Loop, Resource Management and Renderer Design
1 The Application Stage The Game Loop, Resource Management and Renderer Design Application Stage Responsibilities 2 Set up the rendering pipeline Resource Management 3D meshes Textures etc. Prepare data
More informationFruit Snake SECTION 1
Fruit Snake SECTION 1 For the first full Construct 2 game you're going to create a snake game. In this game, you'll have a snake that will "eat" fruit, and grow longer with each object or piece of fruit
More informationDinoXcope User Manual
DinoXcope User Manual Contents 1 System Requirements 1 Installation 2 Adding a time stamp to the live view 3 Capturing an image 4 Creating a real time movie 5 Creating a time-lapse movie 6 Drawing on an
More informationErasmus+ Project: Yestermorrow Year 1 Maths: Pythagorean Theorem
Erasmus+ Project: Yestermorrow Year 1 Maths: Pythagorean Theorem Workshop (Coding Android Mobile Apps): Collision Detection and the Pythagorean Theorem (Based on the code.org worksheet) WORKSHOP OVERVIEW
More informationPick up a book! 2. Is a reader on screen right now?! 3. Embedding Images! 3. As a Text Mesh! 4. Code Interfaces! 6. Creating a Skin! 7. Sources!
Noble Reader Guide Noble Reader version 1.1 Hi, Toby here from Noble Muffins. This here is a paginating text kit. You give it a text; it ll lay it out on a skin. You can also use it as a fancy text mesh
More informationMIDIPoet -- User's Manual Eugenio Tisselli
MIDIPoet -- User's Manual 1999-2007 Eugenio Tisselli http://www.motorhueso.net 1 Introduction MIDIPoet is a software tool that allows the manipulation of text and image on a computer in real-time. It has
More informationGUI Output. Adapted from slides by Michelle Strout with some slides from Rick Mercer. CSc 210
GUI Output Adapted from slides by Michelle Strout with some slides from Rick Mercer CSc 210 GUI (Graphical User Interface) We all use GUI s every day Text interfaces great for testing and debugging Infants
More informationA Summoner's Tale MonoGame Tutorial Series. Chapter 3. Tile Engine and Game Play State
A Summoner's Tale MonoGame Tutorial Series Chapter 3 Tile Engine and Game Play State This tutorial series is about creating a Pokemon style game with the MonoGame Framework called A Summoner's Tale. The
More informationCS 4300 Computer Graphics
CS 4300 Computer Graphics Prof. Harriet Fell Fall 2011 Lecture 8 September 22, 2011 GUIs GUIs in modern operating systems cross-platform GUI frameworks common GUI widgets event-driven programming Model-View-Controller
More informationECE 104 Fundamentals of Computer Graphics Project 1
ECE 104 Fundamentals of Computer Graphics Project 1 Due date: April 19 th, 2002 Project Objectives: As part of this warm-up project you will (1) create your first working graphics program based on OpenGL,
More informationthe gamedesigninitiative at cornell university Lecture 10 Memory Management
Lecture 10 Gaming Memory (Current Generation) Playstation 4 8 GB RAM (unified) X-Box One (X) 12 GB RAM (unified) 9 GB for games Nintendo Switch 3 GB RAM (unified) 1 GB only for OS iphone/ipad 2 GB RAM
More informationCPSC 436D: Video Game Programming Intro to Game Graphics Assignment
CPSC 436D: Video Game Programming Intro to Game Graphics Assignment Due: 23:59 PM, Friday January 18, 2019 1 Introduction The goal of this assignment is to introduce you to basic graphics interface programming.
More informationthe gamedesigninitiative at cornell university Lecture 12 2D Animation
Lecture 12 2D Animation Animation Basics: The FilmStrip Animation is a sequence of hand-drawn frames Smoothly displays action when change quickly Also called flipbook animation Arrange animation in a sprite
More informationChapter Answers. Appendix A. Chapter 1. This appendix provides answers to all of the book s chapter review questions.
Appendix A Chapter Answers This appendix provides answers to all of the book s chapter review questions. Chapter 1 1. What was the original name for the first version of DirectX? B. Games SDK 2. Which
More informationAnnouncements. Submitting Programs Upload source and executable(s) (Windows or Mac) to digital dropbox on Blackboard
Now Playing: Vertex Processing: Viewing Coulibaly Amadou & Mariam from Dimanche a Bamako Released August 2, 2005 Rick Skarbez, Instructor COMP 575 September 27, 2007 Announcements Programming Assignment
More informationDesign of a dynamic simulation system for VR applications
Design of a dynamic simulation system for VR applications Jan Bender Abstract A dynamic simulation system for VR applications consists of multiple parts. The first task that must be accomplished is the
More informationJava Programming. Computer Science 112
Java Programming Computer Science 112 Recap: Swing You use Window Builder to put Widgets together on a Layout. User interacts with Widgets to produce Events. Code in the Client Listens for Events to know
More informationHands-On Workshop: 3D Automotive Graphics on Connected Radios Using Rayleigh and OpenGL ES 2.0
Hands-On Workshop: 3D Automotive Graphics on Connected Radios Using Rayleigh and OpenGL ES 2.0 FTF-AUT-F0348 Hugo Osornio Luis Olea A P R. 2 0 1 4 TM External Use Agenda Back to the Basics! What is a GPU?
More information2D Graphics in XNA Game Studio Express (Modeling a Class in UML)
2D Graphics in XNA Game Studio Express (Modeling a Class in UML) Game Design Experience Professor Jim Whitehead February 5, 2008 Creative Commons Attribution 3.0 creativecommons.org/licenses/by/3.0 Announcements
More informationGROW-IT. Plug-in for Daz3D Studio
GROW-IT Plug-in for Daz3D Studio About A Daz3D plug-in to create 3D animate landscapes for films, cartoons, 2D/3D games and static scene. Other ideas such as wedding-trees where the guest put a finger
More informationSoftware Development & Education Center. Java Platform, Micro Edition. (Mobile Java)
Software Development & Education Center Java Platform, Micro Edition (Mobile Java) Detailed Curriculum UNIT 1: Introduction Understanding J2ME Configurations Connected Device Configuration Connected, Limited
More informationComposite Pattern Diagram. Explanation. JavaFX Subclass Hierarchy, cont. JavaFX: Node. JavaFX Layout Classes. Top-Level Containers 10/12/2018
Explanation Component has Operation( ), which is a method that applies to all components, whether composite or leaf. There are generally many operations. Component also has composite methods: Add( ), Remove(
More informationCHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY CS2401 COMPUTER GRAPHICS QUESTION BANK
CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CS2401 COMPUTER GRAPHICS QUESTION BANK PART A UNIT I-2D PRIMITIVES 1. Define Computer graphics. 2. Define refresh
More informationCollaboration policies!
Tic is over! Collaboration policies! How was the signup process? Were they helpful? Would you rather have more TA hours instead? Design checks You can run demos! cs195n_demo tac2 zdavis cs195n_demo tic
More informationMultithreading and Interactive Programs
Multithreading and Interactive Programs CS160: User Interfaces John Canny. Last time Model-View-Controller Break up a component into Model of the data supporting the App View determining the look of the
More informationMore on Coordinate Systems. Coordinate Systems (3) Coordinate Systems (2) Coordinate Systems (5) Coordinate Systems (4) 9/15/2011
Computer Graphics using OpenGL, Chapter 3 Additional Drawing Tools More on Coordinate Systems We have been using the coordinate system of the screen window (in pixels). The range is from 0 (left) to some
More information