{"id":271,"date":"2015-09-25T11:02:44","date_gmt":"2015-09-25T09:02:44","guid":{"rendered":"http:\/\/l-engel.de\/?p=271"},"modified":"2015-11-27T10:36:14","modified_gmt":"2015-11-27T08:36:14","slug":"multiplayer-racer","status":"publish","type":"post","link":"http:\/\/larsengel.eu\/?p=271","title":{"rendered":"Bomb &#8216;n Tune"},"content":{"rendered":"<p><video controls=\"controls\" width=\"100%\"><source src=\"http:\/\/larsengel.eu\/wp-content\/uploads\/2015\/11\/00%20-%20BombNTune_Trailer.mp4\" type=\"video\/mp4\" \/>Your browser does not support the video tag.<\/video><\/p>\n<h2>\u00a0Motivation<\/h2>\n<p style=\"padding-left: 30px;\">Second\u00a0screen is conquering the video game scene. Big companies like Nintendo or Sony implemented such features in their latest consoles. Nintendo created the <a href=\"https:\/\/www.nintendo.co.uk\/Wii-U\/Hardware-Features\/Wii-U-GamePad\/Wii-U-GamePad-663028.html\" target=\"_blank\"><em>Wii U\u00a0GamePad<\/em><\/a>, which has an integrated display, while Sony uses the <em><a href=\"https:\/\/www.playstation.com\/en-us\/explore\/psvita\/\" target=\"_blank\">PS Vita<\/a><\/em> to enable\u00a0<em>Remote Play.<\/em><\/p>\n<p style=\"padding-left: 30px;\">The problem with both of the described systems is that you need special hardware to be able to use the second screen features. Nowadays nearly everybody possesses a smartphone, which has a multi core processor. So why don&#8217;t we use the hardware, that we are carrying around with us all the time, as a second screen device?<\/p>\n<p style=\"padding-left: 30px;\">This project evaluates the use of a second screen game created with the HTML5 game engine <em><a href=\"http:\/\/phaser.io\/\" target=\"_blank\">Phaser<\/a><\/em>.<\/p>\n<p style=\"padding-left: 30px;\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-360 aligncenter\" src=\"http:\/\/www.creative-technologies.de\/wp-content\/uploads\/2015\/09\/inagme_player_smaller.gif\" alt=\"inagme_player_smaller\" width=\"358\" height=\"193\" \/><\/p>\n<p style=\"padding-left: 30px;\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-356 aligncenter\" src=\"http:\/\/www.creative-technologies.de\/wp-content\/uploads\/2015\/09\/ingame_spectator_smaller.gif\" alt=\"ingame_spectator_smaller\" width=\"374\" height=\"192\" \/><\/p>\n<h2>Gameplay<\/h2>\n<p style=\"padding-left: 30px;\">In this game the smartphone acts as the controller (Player), while an other device with ideally a big screen acts as the spectator.<br \/>\nThe game proceeds in two\u00a0different phases.<\/p>\n<h4 style=\"padding-left: 30px;\">Game phase:<\/h4>\n<p style=\"text-align: center; padding-left: 60px;\"><strong>The car<img loading=\"lazy\" decoding=\"async\" class=\" wp-image-316 alignnone\" src=\"http:\/\/www.creative-technologies.de\/wp-content\/uploads\/2015\/09\/output_Vt0xNR.gif\" alt=\"output_Vt0xNR\" width=\"74\" height=\"55\" \/><\/strong><\/p>\n<p style=\"padding-left: 60px;\">Every player controls a car. Each car has the abilities to\u00a0ignite a nitro and to fire a blast, that is blasting the other cars in the area away.<\/p>\n<p style=\"text-align: center; padding-left: 60px;\"><strong>The ball\u00a0<img loading=\"lazy\" decoding=\"async\" class=\" wp-image-318 alignnone\" src=\"http:\/\/www.creative-technologies.de\/wp-content\/uploads\/2015\/09\/output_Acm2e2.gif\" alt=\"output_Acm2e2\" width=\"48\" height=\"48\" \/><\/strong><\/p>\n<p style=\"padding-left: 60px;\">The ball as the key feature in the game needs to be hit\u00a0by the cars. Each hit gives the player a point and a coin\u00a0and increments the counter of the ball by one. The hundredth hit lets the ball explode and takes the cars nearby along. Exploded cars loose their points but keep their coins for the tuning phase.<\/p>\n<p style=\"text-align: center; padding-left: 60px;\"><strong>Trapdoors\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"wp-image-320\" src=\"http:\/\/www.creative-technologies.de\/wp-content\/uploads\/2015\/09\/output_DtcNKe.gif\" alt=\"output_DtcNKe\" width=\"45\" height=\"46\" \/><\/strong><\/p>\n<p style=\"text-align: left; padding-left: 60px;\">The level of chaos is increased by trapdoors, that are spread over the map. The trapdoor open in irregular intervals. Players, that are falling into open trapdoors, loose their points but keep their coins for the tuning phase.<\/p>\n<p style=\"text-align: center; padding-left: 60px;\"><strong>Bumpers<img loading=\"lazy\" decoding=\"async\" class=\"wp-image-323\" src=\"http:\/\/www.creative-technologies.de\/wp-content\/uploads\/2015\/09\/output_xJdotD.gif\" alt=\"output_xJdotD\" width=\"56\" height=\"49\" \/><\/strong><\/p>\n<p style=\"text-align: left; padding-left: 60px;\">The bumpers, that are located in the corners of the map, let the ball rebound and ensure, that the ball does not get stuck in the corners.<\/p>\n<h4 style=\"text-align: left; padding-left: 30px;\">Tuning Phase:<\/h4>\n<p style=\"padding-left: 60px;\">After the ball is exploded or if any player but one is fallen into a trapdoor, the second game phase, the\u00a0<span style=\"text-decoration: underline;\">tuning phase<\/span> begins. In the tuning phase each player can\u00a0improve the following features of his car:<\/p>\n<p style=\"padding-left: 60px;\"><span style=\"text-decoration: underline;\">Speed<\/span>: Tuning the speed \u00a0increases the top speed of the car.<br \/>\n<span style=\"text-decoration: underline;\">Handling<\/span>: Handling determines the turn speed and the acceleration of the car.<br \/>\n<span style=\"text-decoration: underline;\">Armor<\/span>: Increasing the\u00a0armor value improves the behavior of a car, when it is hit by a blast.<br \/>\n<span style=\"text-decoration: underline;\">Ammunition<\/span>: Ammunition is the amount of blasts a player can shoot during one round.<br \/>\n<span style=\"text-decoration: underline;\">Boost<\/span>: The boost value is the amount of \u00a0nitro boost a player can use during one round.<\/p>\n<p style=\"padding-left: 60px;\">After twenty seconds the next game phase starts automatically.<\/p>\n<h2>Programming<\/h2>\n<p style=\"padding-left: 30px;\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-368 aligncenter\" src=\"http:\/\/www.creative-technologies.de\/wp-content\/uploads\/2015\/09\/racer_diagram.png\" alt=\"racer_diagram\" width=\"471\" height=\"264\" align=\"left\" \/>The game was programmed using the JavaScript\u00a0framework <a href=\"https:\/\/www.meteor.com\/\" target=\"_blank\">Meteor<\/a>\u00a0and the HTML5 game engine <a href=\"http:\/\/phaser.io\/\" target=\"_blank\">Phaser<\/a>. On the server meteor enables the use of\u00a0<a href=\"https:\/\/nodejs.org\/\" target=\"_blank\">Node.js<\/a>\u00a0and has integrated support for WebSocket\u00a0communication between the server and the clients.<\/p>\n<p style=\"padding-left: 30px;\">With HTML5 you have the possibility\u00a0to use the hardware sensors of devices like smartphones. It is possible to get information of, for example, the accelerometer. In this project the accelerometer was used to detect a shake of the device. Another HTML5 feature, that was used was the\u00a0<em>Vibration API<\/em> to give the user feedback for specific events. Unfortunately HTML5 is not supported equally by all browsers. The Virbations API, for example, is not working on the Safari Browser for iOS devices. This leads to an inconsistent game behavior on different devices and can only be solved by finding exceptions for not supported\u00a0features. But it can be assumed that the support for HTML5 features will improve with every upcoming browser update.<\/p>\n<p style=\"padding-left: 30px;\">Phaser is an open source framework to create Canvas or WebGL powered HTML5 browser games. The focus on mobile browsers ensures that every available feature works good on a mobile device. Because it is open source and comes as one single JavaScript file it is easily expandable or can be easily integrated in other frameworks. The three build-in physics engines (<a href=\"http:\/\/phaser.io\/docs\/2.3\/Phaser.Physics.Arcade.html\" target=\"_blank\">Arcade<\/a>, <a href=\"http:\/\/phaser.io\/docs\/2.4.3\/Phaser.Physics.Ninja.html\" target=\"_blank\">Ninja<\/a>\u00a0or <a href=\"http:\/\/phaser.io\/docs\/2.4.3\/Phaser.Physics.P2.html\" target=\"_blank\">P2.JS<\/a>) give the developer the freedom to choose the best fitting physics behavior. In this project P2.JS\u00a0was used since it is the most complex of the three engines and gives the most freedom for the development.<\/p>\n<h2>Art<\/h2>\n<p style=\"padding-left: 30px;\">The game is presented in a cartoon style and uses an <a href=\"http:\/\/www3.ul.ie\/~rynnet\/keanea\/isometri.htm\" target=\"_blank\">isometric projection<\/a> as the perspective. The isometric projection enables a visual representation of three dimensions where technically only two dimensions are possible.<\/p>\n<p style=\"padding-left: 30px;\">The car was created with\u00a0the 3D graphics and animation software <a href=\"https:\/\/www.blender.org\/\" target=\"_blank\">Blender<\/a>. A turnaround was animated and exported as single frames. Those frame where combined to a sprite sheet with the tool <a href=\"https:\/\/www.codeandweb.com\/texturepacker\" target=\"_blank\">Texturepacker<\/a>.<br \/>\nSince the game is playable with up to 30 players it is necessary\u00a0to have 30 different colored cars. The car was exported in grayscale and later on tinted dynamically in the program code.<\/p>\n<p><a href=\"http:\/\/www.creative-technologies.de\/wp-content\/uploads\/2015\/09\/car1_spritesheet.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-409\" src=\"http:\/\/www.creative-technologies.de\/wp-content\/uploads\/2015\/09\/car1_spritesheet.png\" alt=\"car1_spritesheet\" width=\"1500\" height=\"222\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p style=\"padding-left: 30px;\">Other game elements like the traps or bumpers where animated using <a href=\"http:\/\/www.adobe.com\/de\/products\/flash.html\" target=\"_blank\">Adobe Flash<\/a>\u00a0and also packed to a sprite sheet with Texturepacker. To complete the cartoon look a font was created and could be used as\u00a0<a href=\"http:\/\/phaser.io\/docs\/2.3\/Phaser.BitmapText.html\" target=\"_blank\">bitmap text<\/a>\u00a0in the game.<\/p>\n<h2>Team:<\/h2>\n<ul>\n<li>Programming: Lars Engel<\/li>\n<li>Art \/ Music: <a href=\"http:\/\/lukaspilgrim.com\/\">Lukas Fritsch<\/a><\/li>\n<\/ul>\n<h2>Links:<\/h2>\n<ul>\n<li><a href=\"https:\/\/github.com\/larsengel\/webracer\" target=\"_blank\">Github<\/a>\u00a0Repository<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Your browser does not support the video tag. \u00a0Motivation Second\u00a0screen is conquering the video game scene. Big companies like Nintendo or Sony implemented such features in their latest consoles. Nintendo created the Wii U\u00a0GamePad, which has an integrated display, while Sony uses the PS Vita to enable\u00a0Remote Play. The problem with both of the described [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-271","post","type-post","status-publish","format-standard","hentry","category-game-development-2"],"featured_image_src":null,"author_info":{"display_name":"Lars Engel","author_link":"http:\/\/larsengel.eu\/?author=1"},"_links":{"self":[{"href":"http:\/\/larsengel.eu\/index.php?rest_route=\/wp\/v2\/posts\/271","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/larsengel.eu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/larsengel.eu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/larsengel.eu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/larsengel.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=271"}],"version-history":[{"count":10,"href":"http:\/\/larsengel.eu\/index.php?rest_route=\/wp\/v2\/posts\/271\/revisions"}],"predecessor-version":[{"id":320,"href":"http:\/\/larsengel.eu\/index.php?rest_route=\/wp\/v2\/posts\/271\/revisions\/320"}],"wp:attachment":[{"href":"http:\/\/larsengel.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=271"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/larsengel.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=271"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/larsengel.eu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=271"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}