Computer Games 2014 Selected Game Engines

Similar documents
Computer Games 2011 Selected Game Engines

Computer Games 2012 Game Development

Game Programming with. presented by Nathan Baur

Graphics with libgdx

LibGDX Notes. Using BlueJ. LibGDX Notes

Unity Game Development

Computer Games 2015 Game Development Basics

WebGL Seminar: O3D. Alexander Lokhman Tampere University of Technology

Godot engine Documentation

Visual HTML5. Human Information Interaction for Knowledge Extraction, Interaction, Utilization, Decision making HI-I-KEIUD

LibGDX. André Restivo 1 / 87

the gamedesigninitiative at cornell university Lecture 6 Scene Graphs

MIXED REALITY (AR & VR) WITH UNITY 3D (Microsoft HoloLens)

WebGL (Web Graphics Library) is the new standard for 3D graphics on the Web, designed for rendering 2D graphics and interactive 3D graphics.

MIXED REALITY (AR & VR) WITH UNITY 3D (Microsoft HoloLens)

WebSphere Puts Business In Motion. Put People In Motion With Mobile Apps

Computer Games 2012 Game Development

WEB GRAPHICS ADOBE PHOTOSHOP CS3. Learning Outcomes:

the gamedesigninitiative at cornell university Lecture 12 Scene Graphs

INTRO TO COCOS2D. 360iDev 2011

Appendix A ACE exam objectives map

HTML5 in Action ROB CROWTHER JOE LENNON ASH BLUE GREG WANISH MANNING SHELTER ISLAND

HTML5 Evolution and Development. Matt Spencer UI & Browser Marketing Manager

IOS PERFORMANCE. Getting the most out of your Games and Apps

12/15/2008. All about Game Maker. Integrated Development Environment for 2D games Global idea

Lecture 1 Introduction to Android. App Development for Mobile Devices. App Development for Mobile Devices. Announcement.

ARCHITECTURE FOR CASUAL GAMES

WW.IT-IQ Training & Solutions (PTY) LTD

Mobile Cross Platform Development. Igor Markov

Mobile AR Hardware Futures

Developing the Roadmap - Director Next Survey

AR Standards Update Austin, March 2012

the gamedesigninitiative at cornell university Lecture 10 Memory Management

Computer Graphics - Treasure Hunter

UI Elements. If you are not working in 2D mode, you need to change the texture type to Sprite (2D and UI)

Ciril Bohak. - INTRODUCTION TO WEBGL

Mining the Rendering Power in Web Browsers. Jianxia Xue Jan. 28, 2014

Chapter Answers. Appendix A. Chapter 1. This appendix provides answers to all of the book s chapter review questions.

Baking Blender materials to texture to make them usable in a game engine

Tilengine A 2D graphics engine with raster effects

Introduction to creating 3D UI with BeagleBoard. ESC-341 Presented by Diego Dompe

Visual C# 2010 Express

HTML5 for mobile development.

16. HTML5, HTML Graphics, & HTML Media 웹프로그래밍 2016 년 1 학기 충남대학교컴퓨터공학과

Managing and Optimising for numerous Android Devices

Pong in Unity a basic Intro

READSPEAKER ENTERPRISE HIGHLIGHTING 2.5

excalibur Documentation

Qiufeng Zhu Advanced User Interface Spring 2017

Mobile Image Processing

Session 5.1. Writing Text

Be warned, what you are about to witness may severely inspire you. In collaboration with:

Software Specification of MERTIS: Modifiable, Extensible Real-Time Interactive Simulation System

FlashtoUnity Monday, October 7 th, Flash to Unity User s Manual

Khronos and the Mobile Ecosystem

QT QUICK UI Exam Curriculum

Build high performance video apps for mobile, game consoles, streaming pucks, set top boxes, and smart TVs from a single codebase

the gamedesigninitiative at cornell university Lecture 14 2D Sprite Graphics

PSD to Mobile UI Tutorial

Tizen Framework (Tizen Ver. 2.3)

Mobile Graphics Trends: Applications. Marco Agus, KAUST & CRS4

WebGL. Announcements. WebGL for Graphics Developers. WebGL for Web Developers. Homework 5 due Monday, 04/16. Final on Tuesday, 05/01

Software Development & Education Center. Java Platform, Micro Edition. (Mobile Java)

WHAT IS BFA NEW MEDIA?

Towards Declarative 3D in Web Architecture Jean Le Feuvre

Game Programming with DXFramework. Jonathan Voigt University of Michigan Fall 2005

CS260 Intro to Java & Android 09.AndroidAdvUI (Part I)

Terrain. Unity s Terrain editor islands topographical landscapes Mountains And more

3D PDF Plug-ins for Autodesk products Version 2.0

Index LICENSED PRODUCT NOT FOR RESALE

1 Preview. Dr. Scott Gordon Computer Science Dept. CSUS. Virtual Cameras, Viewing Transformations: CSc-155 Advanced Computer Graphics

What s New in QuarkXPress 2018

Mobile Image Processing

Adding Advanced Shader Features and Handling Fragmentation

Memory Management: High-Level Overview

No more engine requirements! From now on everything you work on is designed by you. Congrats!

2D Graphics in XNA Game Studio Express (Modeling a Class in UML)

Android Software Development Kit (Part I)

Shaders. Slide credit to Prof. Zwicker

Programming Concepts and Skills. Creating an Android Project

<Insert Picture Here> JavaFX Overview April 2010

I m sorry but HTML5 mobile games DO work.

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL II)

ArcGIS API for JavaScript: Getting Started Andy René

Creating outstanding digital cockpits with Qt Automotive Suite

Index. Audio project AudioSupport class, 207 controls, 206 description, 206 GameState class, 209 goals, 206

Introduction To Android

PowerVR Framework. October 2015

Section 28: 2D Gaming: Continuing with Unity 2D

Tips for game development: Graphics, Audio, Sensor bada Developer Day in Seoul Dec 08, 2010

Index. Containers, 94 animation, 96 class, 233 clone method, 97 group object, 95 with shapes, bitmaps and text, 96 with various display objects, 95

COURSE OUTLINE MOC 20480: PROGRAMMING IN HTML5 WITH JAVASCRIPT AND CSS3

Programming HD DVD and Blu-ray Diso The HD Cookbook

Detector controls meets JEE on the web

Blender - Python API #1

Contents in Detail. Who Is This Book For?... xix What s in This Book?... xx. part I: Warming Up 1

Course Syllabus. Course Title. Who should attend? Course Description. Adobe Animate CC

Fixed Size Ad Specifications

Mobile and Wireless Systems Programming

eswt Requirements and High-Level Architecture Abstract Document Information Change History

Transcription:

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 Programming with JavaScript 2D, but hardware accelerated

pixi.js 2D WebGL based renderer With Canvas based fallback Multi-touch capable WebGL filters, tinting, blending Sprite Sheets, asset loader,...

pixi.js Setup Embedded in a simple HTML page: <html> <head> <title>computergames - WegGL Example 1</title> <style> body { background-color: #000000; } </style> <script src="pixi.js"></script> </head> <body>

pixi.js Setup <html> <head> <title>computergames - WegGL Example 1</title> <style> body { margin: 0; padding: 0; background-color: #000000;} </style> <script src="pixi.js"></script> </head> <body> <script> // create an new instance of a pixi stage var stage = new PIXI.Stage(0x66FF99); // create a renderer instance. var renderer = PIXI.autoDetectRenderer(400, 300); // add the renderer view element to the DOM document.body.appendchild(renderer.view); requestanimframe( animate ); function animate() { requestanimframe( animate ); // render the stage renderer.render(stage); } </script> </body> </html>

How to develop with pixi.js? WebGL is not available on local pages! Web server is needed. Consider NetBeans as an option Built-In web server Javascript editor & debugging

Adding a sprite // create a texture from an image path var texture = PIXI.Texture.fromImage("img/bar.png"); // create a new Sprite using the texture var bar = new PIXI.Sprite(texture); // center the sprites anchor point bar.anchor.x = 0.5; bar.anchor.y = 0.5; // move the sprite t the center of the screen bar.position.x = 15; bar.position.y = 50; bar.rotation = Math.PI/2; stage.addchild(bar);

Interaction Using the Keydrown library kd.p.down(function () { console.log('the "P" key is being held down!'); }); kd.p.up(function () { console.clear(); }); // This update loop is the heartbeat of Keydrown kd.run(function () { kd.tick(); });

In our pixi.js game... // add the function keys: function movebardown() { if (bar.position.y < 300) bar.position.y += 5; } function movebarup() { if (bar.position.y > 0) bar.position.y -= 5; } kd.down.down(movebardown); kd.up.down(movebarup); function animate() { // tick keydrown kd.tick(); requestanimframe( animate ); // render the stage renderer.render(stage); }

Add a ball sprite & collision Sprite adding as usual Physics should make sure that... the ball is not stuck in the wall or paddle a collision is detected before the actual event appropriate actions are taken at the right time the outcome is visualized See game04.html file...

pixi.js: What is not there? Audio & Sound Input Physics Network Layer

JavaScript and HTML 5? CocoonJS HTML5 & WebGL for mobile devices Can be packaged in an app Crafty Pure JavaScript & Canvas Scene-based, collision detection... Cocos-2D JS Cocos-2D based, supports many tools

libgdx features High-performance, cross-platform game development framework. Android, ios, Blackberry Windows, Linux & MacOS (Java) HTML 5, WebGL, Javascript Basis for engines and games. e.g. AndEngine

libgdx features Multiple backends Jogl, LWJGL, Android APIs, JavaScript Rendering through OpenGL ES Low level & high level 3D

libgdx features High level 2D Batched and cached sprite rendering Bitmap fonts Particle systems TMX tile map rendering UI system and many more features,

libgdx features Audio Music and SFX from WAV, MP3 and OGG Audio decoding of OGG and MP3 File I/O Abstracting Android assets, classpath and filesystem JavaScript binary files,

libgdx features Input Polling and event-based access to touchscreen/mouse and keyboard. Polling access to compass and accelerometer Vibration support Remote input event processing Physics Full JNI wrapper of box2d

libgdx features Tools & Extensions Particle editor Bitmap font generator Texture packer

libgdx - Multiplatform Game implements ApplicationListener LWJGL Application Android Application

HelloWorld public class HelloWorld implements ApplicationListener { SpriteBatch spritebatch; Texture texture; BitmapFont font; Vector2 textposition = new Vector2(100, 100); Vector2 textdirection = new Vector2(1, 1); @Override public void create () { font = new BitmapFont(); font.setcolor(color.red); [ ] src. http://code.google.com/p/libgdx

HelloWorld LWJGL public class HelloWorldDesktop { public static void main(string[] argv) { GdxTestGame game = new GdxTestGame(); new LwjglApplication(new HelloWorld(), "Hello World", 480, 320, false); } } src. http://code.google.com/p/libgdx

HelloWord Jogl public class HelloWorldDesktop { public static void main (String[] argv) { new JoglApplication(new HelloWorld(), "Hello World", 480, 320, false); } } src. http://code.google.com/p/libgdx

HelloWorld Android public class HelloWorldAndroid extends AndroidApplication { } @Override public void oncreate (Bundle savedinstancestate) { } super.oncreate(savedinstancestate); initialize(new HelloWorld(), false); src. http://code.google.com/p/libgdx

libgdx 2D Sprites Textures OpenGL handles all sprites as Textures Textures are decoded images in memory SpriteBatch Takes care of displaying textures Texture mapping and creation of rectangles

Drawing a Single Texture public class TextureFun implements ApplicationListener { private Texture druidtexture; private SpriteBatch batch; @Override public void create() { druidtexture = new Texture(Gdx.files.internal("druid.png")); batch = new SpriteBatch(); } @Override public void render() { batch.begin(); batch.draw(druidtexture, 100, 100); batch.end(); } } // rest of methods omitted // src. http://code.google.com/p/libgdx/wiki/texturestextureregionspritebatch

Drawing a Single Texture src. http://code.google.com/p/libgdx/wiki/texturestextureregionspritebatch

Multiple Calls public void render() { batch.begin(); batch.draw(druidtexture, 100, 100); batch.draw(druidtexture, 200, 100); batch.draw(druidtexture, 300, 100); batch.end(); } src. http://code.google.com/p/libgdx/wiki/texturestextureregionspritebatch

Drawing the textures on top of each other public void render() { batch.begin(); batch.draw(druidtexture, 100, 100); batch.draw(druidtexture, 132, 132); batch.draw(druidtexture, 164, 164); batch.end(); } src. http://code.google.com/p/libgdx/wiki/texturestextureregionspritebatch

Rotation & Scaling public void render() { batch.begin(); batch.draw(druidtexture, 100, 100); batch.draw(druidtexture, 200, 100, 32, 32, 64, 64, 1f, 2.0f, 45f, 0, 0, 64, 64, false, false); batch.end(); } src. http://code.google.com/p/libgdx/wiki/texturestextureregionspritebatch

TextureRegion

TextureRegion public class TextureFun implements ApplicationListener { private Texture texture; private SpriteBatch batch; private TextureRegion[] regions = new TextureRegion[4]; public void create() { texture = new Texture(Gdx.files.internal("sprite_sheet.png")); batch = new SpriteBatch(); regions[0] = new TextureRegion(texture, 0, 0, 64, 64); regions[1] = new TextureRegion(texture, 0.5f, 0f, 1f, 0.5f); regions[2] = new TextureRegion(texture, 0, 63, 64, 64); regions[3] = new TextureRegion(texture, 0.5f, 0.5f, 1f, 1f); } public void render() { batch.begin(); batch.draw(texture, 0, 0, 64, 64); for (int i = 0; i < regions.length; i++) batch.draw(regions[i], 75 * (i + 1), 100); batch.end(); }

TextureRegion... TextureRegion[][] regions = TextureRegion.split(texture, 64, 64)...

Blending & Viewport Viewport is determined automatically Mapping pixels to pixels Determined at begin() Blending Enabled by default Disable for performance critical things

Orthographic Camera Parallel projection from 3D to 2D Used to map game space to view ie. Game is written for full HD. Rendered on various devices.

Orthographic Camera public void create() { camera = new OrthographicCamera(1920, 1080); camera.position.set(1920 / 2, 1080 / 2, 0); //... } public void render() { camera.update(); batch.setprojectionmatrix(camera.combined); batch.begin(); //... }

Using Fonts

Hiero Bitmap Font Tool Creates 2 files myfont.fnt myfont.png

Using Bitmap Fonts // Member BitmapFont font; // [...] // init font from files font = new BitmapFont(new FileHandle(new File("myFont.fnt")), new FileHandle(new File("myFont.png")), false); // [...] // draw in the main loop / sprite batch font.draw(spritebatch, "3765 pts.", 5, Gdx.graphics.getHeight() -5);

Input Interface to the input facilities Allows to poll state of the keyboard touch screen accelerometer Event based input available as InputProcessor

Music Music interface represents streamed audio Music instance is created with Audio.newMusic(FileHandle) Looping, volume, pause and play

Sound Sound interface represents in-memory audio clips Feasible for small files Can be played multiple times at once Looping, volume, play and stop

Walkthrough GdxTestGame

Vielen Dank für die Aufmerksamkeit