Search the Community

Showing results for tags 'javascript'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 617 results

  1. DynamicTextures on a Cube

    Hello again! I was playing around with some of the examples (love the playground). In this instance I was looking at a PG that created a ground and applied a dynamic texture to it. For kicks, I changed it to a Cube, but noticed that whatever I drew on the dynamic texture would show up on all 6 sides. Is there a way to make it so that if I draw a star on one side its not duplicated on the others? Thanks for your time
  2. Hey, i have creating android hybrid games. i have babylonJS javascript framework for game. The skybox object textures does not loading properly. other object are loading normally in my game. var skybox = BABYLON.MeshBuilder.CreateBox("skyBox", {size:100.0}, game_scene); skybox.position = new BABYLON.Vector3(0, 0, 0); var skyboxMaterial = new BABYLON.StandardMaterial("skyBox", game_scene); skyboxMaterial.backFaceCulling = false; skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("textures/hills", game_scene); skyboxMaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE; skyboxMaterial.diffuseColor = new BABYLON.Color3(0, 0, 0); skyboxMaterial.specularColor = new BABYLON.Color3(0, 0, 0); skybox.material = skyboxMaterial;
  3. Hey , If i Multiple objects loaded time the device is hanging. i have using small objects only 3 or 5 mb file objects only. how to solve this type of problem.
  4. I have all sorts of game ideas, but I quickly run into a brick wall since I'm not really an artist. Are there any guides out there for creating simple "programmer art" for games? Even better, are there any website for free game art?
  5. This might seem like a ridiculous question, but I was just curious to hear your input on the subject. In brief, I have spent a lot of time learning web development (specifically the front-end). Although, I recently gained interest in creating games with JavaScript frameworks such as Phaser. With that said, is there anything wrong with making simple 2D games for mobile using JavaScript code and something like PhoneGap to get it on mobile stores? Do any of you currently do this? Or should I change my focus to Unity and C#?
  6. Hey everyone, I've just started working with Babylon.js and I have a question. I've got a double array filled with 1 & 0 and I want it tranformed to 3d. 1 being blocks and 0 spaces. I did it this way: var sizeFactor = 0.2; for (var i = 0; i < array.length; i++) { for (var j = 0; j < array[0].length; j++) { if (array[i][j] === 1) { var box = BABYLON.MeshBuilder.CreateBox('box', {height: sizeFactor, width: sizeFactor, depth: sizeFactor}, scene); box.position.x = i * sizeFactor; box.position.y = 0; box.position.z = j * sizeFactor; } } } but its very taxing I believe to the system because of the many boxes. Is there any other less taxing way to achieve this?
  7. Hey guys! I am kinda new to PIXI so I apologize if there is a super obvious fix to this problem but I am having a super hard time getting display objects I called buttons to show up. Button 1 and the TilingSprite appear just fine but the rest of the buttons do not. I looked at the contents of app.stage in my console and it says the buttons are all in there. Thanks in advance for the help! function playerSelect(){ // var onClick = function(){ new characterSelect()}; var stage = new PIXI.Container(); stage.visible = true // var container = new PIXI.Container(); var button1 = new Button("resources/button-small.png", 323, 162); var player1 = new Button("resources/player-select-buttons/1player-noselect.png", 293, 575); var player2 = new Button("resources/player-select-buttons/2player-noselect.png", 293, 575); var player3 = new Button("resources/player-select-buttons/3player-noselect.png", 293, 575); var player4 = new Button("resources/player-select-buttons/4player-noselect.png", 293, 575); //selected var player1Select = new Button("resources/player-select-buttons/1player-selected.png", 293, 575); var player2Select = new Button("resources/player-select-buttons/2player-selected.png", 293, 575); var player3Select = new Button("resources/player-select-buttons/3player-selected.png", 293, 575); var player4Select = new Button("resources/player-select-buttons/4player-selected.png", 293, 575); button1.position.x = 800; button1.position.y = 900; player1.position.x = 323; player1.position.y = 227; player2.position.x = 653; player2.position.y = 227; player3.position.x = 975; player3.position.y = 227; player4.position.x = 1300; player4.position.y = 227; player1Select.position.x = 323; player1Select.position.y = 227; player2Select.position.x = 653; player2Select.position.y = 227; player3Select.position.x = 975; player3Select.position.y = 227; player4Select.position.x = 1300; player4Select.position.y = 227; button1.on("mousedown", function(){ stage.visible = false; new characterSelect()}); player1.on("mousedown", function(){ stage.addChild(player1Select) }); player2.on("mousedown", function(){ // stage.removeChildren(); stage.addChild(player2Select)}); player3.on("mousedown", function(){ app.stage.addChild(player3Select)}); player4.on("mousedown", function(){ app.stage.addChild(player4Select)}); player1Select.on("mousedown", function(){ console.log("hit")}); app.stage = stage; var renderer = PIXI.autoDetectRenderer( 1920, 1080, {view:document.getElementById("game-canvas")} ); //switch to png PIXI.loader .load(function(){ var b = PIXI.Texture.fromImage("./resources/playerSelection-final.png"); var tilingSprite = new PIXI.extras.TilingSprite(b, 1920, 1080); tilingSprite.alpha=0.5; stage.addChild(tilingSprite); stage.addChild(button1); stage.addChild(player2); stage.addChild(player1); stage.addChild(player3); stage.addChild(player4); renderer.render(stage); }); } function Button(path, width, height) { var texture = PIXI.Texture.fromImage(path);, texture, width, height); this.tilePosition.x = 0; this.tilePosition.y = 0; this.interactive = true; this.buttonMode = true; this.viewportX = 0; } Button.prototype = Object.create(PIXI.extras.TilingSprite.prototype); Button.prototype.setViewportX = function(newViewportX) { var distanceTravelled = newViewportX - this.viewportX; this.viewportX = newViewportX; this.tilePosition.x -= (distanceTravelled * button.DELTA_X); };
  8. In-game loading bar

    Hey guys, I have made a game that needs to parse and render large save files. The issue I have is that whiles the javascript in Phaser is doing its thing all I can do is show a gif spinner in html whiles the player waits for the game to load. I would like to show a progress bar, I have made a global var that basically ticks up at key intervals in the loading process. The problem is is that the number does increment however the UI in phaser does not update as well as the HTML (in html I just made a update tick and read the loadingProgress var every tick) . I have tested this using debug.text, html span and a phaser ext object. My entire game just locks up when processing stuff but I would like a hook that could be independent and update a number at core intervals.
  9. Hello everyone!, I'm stuck with my 2d game.. i'm trying to give certain sprites a on mousehover event(i dont really know if this is possible lel but i am really new with canvas so pleas help me out). does anyone know a better way or the sollution for this??? regards, slyvan25
  10. multiplayer online card game

    hello i want to make a online multiplayer online card game using phaser. CAn you please help me in this that from where i would start??
  11. Hi, Our company develop simulations of aircraft systems. We are looking for developers that use Phaser Editor, and has knowledge of Typescript or Javascript and Phaser. Also we will provide you our own framework for developing easier and faster. It's a fully freelance job and we will give you only deadline. Payment method is open to negotiation. You can check our examples here:
  12. Hi! I did a Game Jam recently, our group used the p5 library because someone suggested it to us, and indeed it helped us develop an ok prototype in a short amount of time. The game wasn't perfect at all of course, because 48 hours is still really short, but one of the main flaws that bothered me was the graphic integration; our graphistes liked working with pixel art, and we used a tileset to create the background map, which didn't tile right, with grey line appearing between tiles; on top of that, the other sprites didn't look nice at high resolution either, because of linear filtering. After the Jam ended, I decided to try to fix these. I found the way to activate nearest filter in p5, which made the graphics look way better, but still not as nice as I wanted it to be. After googling a bit, I found this article, which was exactly what I was looking for. Then I noticed... in order to use shaders, I needed to switch the context to WebGL, which meant changing most of the code. This didn't actually bother me, so I started working on it, it was quite a nightmare (because of p5's bugs and lacks of integration...) but when I got to the point where I had basically the same game then before, but switched to a WebGL context (without the shaders), I noticed HUGE performance drops (I'm talking 10 FPS for displaying something 400 sprites in a 500 * 500 context!!!). That's when I decided that I needed to switch to a different library. A little more googling later, I opted for the PIXI library, which, I must agree, is a nice library to work with, even though the official documentation is lacking a bit of informations. I started recoding the game from scratch once again, and as soon as I could draw the map on screen, I tried to implement the pixel art shader; I copy-pasted the code and... Magic! It didn't work. I was actually not that surprised, and decided to play around with the GLSL to see where the problem was. That's when I started noticing strange things: weird texture offsets that I tried to adjust for manually, which didn't work because the offset changed depending on the scaling of the image... and then the texture itself, scaling itself up and down when I scaled the sprite... After a while and thanks to more googling, I found out that Pixi did some pre-processing on both the texture and the texture coordinates which were passed to the fragment shaders. I tried adjusting for it, I tried a lot, I got close, but it's still really messy, and float precision starts doing strange things that makes the textures look even worst then before. That's where I am now. I tried searching for others libraries, but most of them seemed to be either 3D libraries, or probably as weak as p5, so I'm here to ask, is there a good library that I can work with which won't bring me such problems? Or is there something I can do to fix my problem with PIXI? Or should I just resort to using webGL without any additional library (which at this point seems like the best solution to me)?
  13. Canvas Tilemaps - Javascript Help

    Ello guv'nors! GOOGLE HAS FAILED ME! I got some dumb probably really easy javascript things I'm stuck with and I'm in an endless loop of eh? So I've got the this array 0 = wall = cant move into 1 = path = can move into * white 1 = player start point var gamemap = [ 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, im also abit lost on how to make the character use a nested array two values on each? merge two arrays together? concat? idk... use of north east south west buttons that move the player one array over? on the click of a button CHECK show text saying if can or cant go in direction because wall etc Anyone fancy pointing me towards the right direction? If this makes any sense.
  14. Hi there! We’re looking for a talented, self-motivated and experienced Full Stack Developer to build games for Africa. About Us: Big5 Games is a Gamification Platform for Africa. We’re on a mission to get Africans playing more games! We’re working on a range of games to entertain and educate utilising the latest technologies and platforms. Core Skills: • Full Stack JavaScript Developer • Solid skill set in Node.js, MongoDB, Angular • Good knowledge of JavaScript, ES6, HTML5, CSS • Knowledge of React • Experience with test frameworks • Ability to apply programming and documentation principles • Able to work remotely with other team members • Good communication skills Bonus Skills: • Experience in HTML5 game development • Knowledge of game engines and services such as: GameMaker, PlayFab, Phaser, Facebook Instant Games • Knowledge of cloud systems such as Heroku and CloudFlare • Familiarity with the Lean Startup and Agile Methodologies About You: Timely and committed - you manage your time well. Quality-driven - you create great work you’re proud of! Fast learner - you’ll learn a lot with us, and we move fast! Team player - you share, discuss, ask for advice, and report on your work on yourself. You’ll work independently, we don’t want to be on your back. Passionate about technology - you are interested in new technologies and experiment with your own projects. We Offer You: Exciting, dynamic and ambitious projects to work on. Flexibility to work remotely where you want and when you want. This is a fully remote role. Join our open, collaborative culture (we want to share our knowledge as well as learn from you!) Develop your entrepreneurial side. Additional opportunities as we grow and learn together. Big5 Games is an equal opportunity employer. We’re excited to work with talented and empathetic people no matter their race, colour, gender, sexual orientation, religion, national origin, physical disability, or age.
  15. I have created a sample map using tiled software. Then tried to load the same u on webpage using phaser.js. But I am not getting the proper result. Is there any mistake in my code or something wrong with library. <!DOCTYPE html> <html> <head> <title>Basic Platformer game</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width"> <script src="js/phaser.min.js"></script> <script src="js/phaser.js"></script> </head> <body> <div id="phaser-game"></div> <script type="text/javascript"> (function() { var game = new Phaser.Game( 800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render: render }); function preload() { game.load.tilemap('map', 'background.json', null, Phaser.Tilemap.TILED_JSON); game.load.image('tile2', 'floor2.png'); game.load.image('player','bot2.png'); } var map; var layer; var marker; var player; var currentTile; var cursors; var curser; function create() { game.stage.backgroundColor = '#787878'; game.physics.startSystem(Phaser.Physics.P2JS); map = game.add.tilemap('map'); map.addTilesetImage('floor2','tile2'); currentTile = map.getTile(0, 0); layer = map.createLayer('Tile Layer 1'); player = game.add.sprite(20, 20, 'player'); game.physics.p2.enable(player); player.body.fixedRotation = true; layer.resizeWorld(); marker =; marker.lineStyle(2, 0x000000, 1); marker.drawRect(0, 0, 20, 20); cursors = game.input.keyboard.createCursorKeys();, Phaser.Camera.FOLLOW_LOCKON, 0.1, 0.1); game.physics.arcade.enable(player); </script> </body> </html>
  16. Hello people ! I'm working on a project code in javascript without using any framework and I struggle with keyboard input. I would like to disable window (or document, I don't know the difference) keyboard detection while I'm in game, because the webpage move each time I use arrows keys to move my player. I already try to use getElementByID('myCanvas').onkeydown but it doesn't work at all ! Here a part of my code : /* In a class name Engine() */ document.onkeydown = checkKey; function checkKey(e) { var keysMap = { 37 : [-1,0], 38 : [0,-1], 39 : [1,0], 40 : [0,1], }; if(e.keyCode>=37 && e.keyCode<=40){ player.setSprite(player.spriteDict[e.keyCode]) game.moveTo(keysMap[e.keyCode][0],keysMap[e.keyCode][1]); } else if(e.keyCode == 82){ game.restart(); } else if (e.keyCode == 85){ game.undo(); } current.drawBoard(); } For more, see the project on Github
  17. It seems that to send a private message to a player, you are supposed to use I need to emit an image to a specific player so am using this concept, however it doesn't seem to work. Would anyone know how to emit an image to a specific client? Thanks!
  18. (On Disconnect) Last player hangs

    I have a multiplayer game that assigns and displays an avatar for each player that accesses the game. When a player leaves the game, it will drop the image so the avatar is no longer on screen. This works - sort of. Here is the problem: Ex: Three players access the game, three avatars are created. Then one player leaves, that avatar is removed from screen. The other two players leave, and for some reason, the last avatar remains on screen. So the host will always see that last avatar sitting there. I'm using splice to remove the players. I check my array and all players dropped from the array. It shows []. I have no clue how that avatar is still there. Is there a way to completely remove that from the game?
  19. Hi! First post here. I'm currently experimenting with the gamepad API and I'm trying to capture the motion/orientation of my dualshock 3 to build controls for a new game project. I was wondering if anyone had manage such a thing and managed to make it work in the browser? It seems that WebVR makes use of the motion data using the gamepad.pose object and so far I've been unlucky to reach it on a regular controller. Has anyone managed such a thing and could help? Thank you!
  20. What I want to do is make it so if the player touches the enemy from the side then the player either loses a life and or it causes the game to be over. But if the player jumps on top of the enemy then it causes that enemy to disappear. If a the player touches an enemy then the player loses a life which is done by running this code... this.status = "lost"; this.finishDelay = 1; How ever if the player jumps on the enemy then the enemy dies which is done by running this code... this.actors = this.actors.filter(function(other) { return other != actor; }); Here is my code so far... Level.prototype.playerTouched = function(type, actor) { } else if (type == "lava" && this.status == null && player.y == enemy.y) { this.status = "lost"; this.finishDelay = 1; } else if (type == "coin" && player.y > enemy.y) { this.actors = this.actors.filter(function(other) { return other != actor; }); } }; The part that I am having trouble with is... when the player touches the enemy while the player is on the ground (the players y axis is equal to the enemys y axis)... player.y == enemy.y and when the player jumps on top of the enemy. (the players y axis is greater then the enemys y axis)... player.y > enemy.y My total code is posted as an attachment platformgame2.html
  21. Hi everyone, // If I make grammar mistakes, please excuse me. I'm still not fluent in English ahah I'm a beginner on Phaser, had to have a look into that for my courses. I'm now upgrading a basic tutorial and I want to use a timer (a countdown) in that game but it really doesn't work, it only create a black screen. To do this, I followed this tutorial : I tried other, without success. Some were a bit to hard to understand, others were pretty ugly ! So here is the code I used , can you help me ? : var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update }); function preload() { game.load.image('sky', 'assets/sky.png'); game.load.image('ground', 'assets/platform.png'); game.load.image('star', 'assets/star.png'); // on ajoute un diamant game.load.image('dmd','assets/diamond.png') game.load.spritesheet('dude', 'assets/dude.png', 32, 48); } var player; var platforms; var cursors; var stars; var diamonds; var score = 0; var scoreText; var countdown; function create() { // We're going to be using physics, so enable the Arcade Physics system game.physics.startSystem(Phaser.Physics.ARCADE); // A simple background for our game game.add.sprite(0, 0, 'sky'); // The platforms group contains the ground and the 2 ledges we can jump on platforms =; // We will enable physics for any object that is created in this group platforms.enableBody = true; // Here we create the ground. var ground = platforms.create(0, - 64, 'ground'); // Scale it to fit the width of the game (the original sprite is 400x32 in size) ground.scale.setTo(2, 2); // This stops it from falling away when you jump on it ground.body.immovable = true; // Now let's create two ledges var ledge = platforms.create(400, 400, 'ground'); ledge.body.immovable = true; ledge = platforms.create(-150, 250, 'ground'); ledge.body.immovable = true; ledge = platforms.create(-100, 510, 'ground'); ledge.body.immovable = true; // The player and its settings player = game.add.sprite(32, - 150, 'dude'); // We need to enable physics on the player game.physics.arcade.enable(player); // Player physics properties. Give the little guy a slight bounce. player.body.bounce.y = 0.2; player.body.gravity.y = 350; player.body.collideWorldBounds = true; // Our two animations, walking left and right. player.animations.add('left', [0, 1, 2, 3], 10, true); player.animations.add('right', [5, 6, 7, 8], 10, true); // Finally some stars to collect stars =; // We will enable physics for any star that is created in this group stars.enableBody = true; // Here we'll create 12 of them evenly spaced apart for (var i = 0; i < 10; i++) { // Create a star inside of the 'stars' group var star = stars.create(i * 70, 0, 'star'); // Let gravity do its thing star.body.gravity.y = 15; // This just gives each star a slightly random bounce value star.body.bounce.y = 0.2 + Math.random() * 0.2; } // On ajoute les diamants; diamonds.enableBody=true; // création des diamants dans l'espace de jeu for (var i = 0; i < 3; i++) { var dmd = diamonds.create(i * 70, 0, 'dmd'); dmd.body.gravity.y = 30; dmd.body.bounce.y = 0.1 + Math.random() * 0.2; } countdown.startTime = new Date(); countdown.totalTime = 120; countdown.timeElapsed = 0; countdown.createTimer(); countdown.gameTimer =, function(){ countdown.updateTimer(); }); // The score scoreText = game.add.text(16, 16, 'score: 0', { fontSize: '32px', fill: '#000' }); // Our controls. cursors = game.input.keyboard.createCursorKeys(); } function update() { // Collide the player and the stars (et les diamants du coup) with the platforms game.physics.arcade.collide(stars, platforms); game.physics.arcade.collide(diamonds, platforms); game.physics.arcade.collide(player, platforms); // Checks to see if the player overlaps with any of the stars, if he does call the collectStar function game.physics.arcade.overlap(player, stars, collectStar, null, this); // idem pour les diamants game.physics.arcade.overlap(player, diamonds, collectDiamonds, null, this); // Reset the players velocity (movement) player.body.velocity.x = 0; if (cursors.left.isDown) { // Move to the left player.body.velocity.x = -150;'left'); } else if (cursors.right.isDown) { // Move to the right player.body.velocity.x = 150;'right'); } else { // Stand still player.animations.stop(); player.frame = 4; } // Allow the player to jump if they are touching the ground. if (cursors.up.isDown && player.body.touching.down) { player.body.velocity.y = -350; } } function collectStar (player, star) { // Removes the star from the screen star.kill(); // Add and update the score score += 10; scoreText.text = 'Score: ' + score; } function collectDiamonds (player, dmd) { dmd.kill(); score += 50; scoreText.text = 'Score: ' + score; } function createTimer(){ var countdown = this; countdown.timeLabel =, 100, "00:00", {font: "100px Arial", fill: "#fff"}); countdown.timeLabel.anchor.setTo(0.5, 0); countdown.timeLabel.align = 'center'; } function updateTimer (){ var countdown = this; var currentTime = new Date(); var timeDifference = countdown.startTime.getTime() - currentTime.getTime(); //Time elapsed in seconds countdown.timeElapsed = Math.abs(timeDifference / 1000); //Time remaining in seconds var timeRemaining = countdown.timeElapsed; //Convert seconds into minutes and seconds var minutes = Math.floor(countdown.timeElapsed / 60); var seconds = Math.floor(countdown.timeElapsed) - (60 * minutes); //Display minutes, add a 0 to the start if less than 10 var result = (minutes < 10) ? "0" + minutes : minutes; //Display seconds, add a 0 to the start if less than 10 result += (seconds < 10) ? ":0" + seconds : ":" + seconds; countdown.timeLabel.text = result; if(countdown.timeElapsed >= countdown.totalTime){ // On cherche la fin du timer result = "Rate !"; } }
  22. Camera problem - following player

    Hello I'm having an interesting problem with my camera, this is how my game looks without the camera following the player this is how it looks following the player... (the only good thing is that it actually follows the player) but I would like to know how to set up the bounds of the camera and to make sure it doesn't ... well do this. here's my code : scenes.scene3 = function(){}; //Player speed var link, vel = 150; //Map/Level var map; //Tiled Layers var floor, water,walls; //Object Tiled Layers var rocks var bushes1, bushes2, bushes3, bushes4; scenes.scene3.prototype = { preload: function (){ game.load.image('tiles', 'Assets/Sprites/Levels/zelda_01.png'); music ='openWorld'); music.addMarker('openWorld', 0, 16, true); game.renderer.resize( 1216/2, 800/2); }, create: function (){ //Game itself,0, 1216, 800); game.physics.startSystem(Phaser.Physics.ARCADE); map = game.add.tilemap('level_01'); map.addTilesetImage('tiles'); floor = map.createLayer('ground'); walls = map.createLayer('walls'); water = map.createLayer('water'); map.setCollisionBetween(0, 100, true, 'walls'); map.setCollisionBetween(0, 100, true, 'water'); //Objects layer related rocks = game.add.physicsGroup(); map.createFromObjects('rocks','ROCK','tiles', 48, true, false, rocks); rocks.forEach(function(rocks){rocks.body.immovable = true;}); bushes = game.add.physicsGroup(); map.createFromObjects('bushes', 'BUSHTOP', 'tiles', 37, true, false , bushes); map.createFromObjects('bushes', 'BUSHBOT', 'tiles', 35, true, false , bushes); map.createFromObjects('bushes', 'BUSHLEFT', 'tiles', 36, true, false , bushes); map.createFromObjects('bushes', 'BUSHRIGHT', 'tiles', 34, true, false , bushes); bushes.forEach(function(bushes){bushes.body.immovable = true;}); //'openWorld', 0,1,true); // Player link = game.add.sprite((centerX-500), 100, 'LinkMovement'); link.scale.setTo(0.25, 0.25); link.animations.add('walkHorizontalRight', [6,7,8]); link.animations.add('walkHorizontalLeft', [9,10,11]); link.animations.add('walkVerticalDown', [0,1,2]); link.animations.add('walkVerticalUp', [3,4,5]); game.physics.enable(link); link.body.collideWorldBounds=true; //Life bar life = game.add.sprite((centerX-600), (centerY-675), 'lifeBar'); life.scale.setTo(0.15, 0.15); life.animations.add('fullHP', [0]); life.animations.add('twoHP', [1]); life.animations.add('oneHP', [2]); life.animations.add('Dead', [3]); cursors = game.input.keyboard.createCursorKeys(); var b1 = game.add.button(900,300, 'buttonFire', function() {fire();}); b1.scale.setTo(0.25,0.25); = (608,400);; }, update: function (){ game.physics.arcade.collide(link, walls); game.physics.arcade.collide(link, water); game.physics.arcade.collide(link, rocks); game.physics.arcade.collide(link, bushes); if(cursors.up.isDown){ link.body.velocity.y = -vel;'walkVerticalUp', 9, true); } else if(cursors.down.isDown){ link.body.velocity.y = vel;'walkVerticalDown', 9, true); } else{ link.body.velocity.y = 0; link.animations.stop('walkVerticalUp'); link.animations.stop('walkVerticalDown'); } if(cursors.left.isDown){ link.body.velocity.x = -vel;'walkHorizontalLeft', 9, true); } else if(cursors.right.isDown){ link.body.velocity.x = vel;'walkHorizontalRight', 9, true); } else{ link.body.velocity.x = 0; link.animations.stop('walkHorizontalRight'); link.animations.stop('walkHorizontalLeft'); } }, fire: function(){ console.log('firing') var bullet = bullets.getFirstDead(); bullet.reset(link.x, link.y); }, drawHealthBar: function(){ if (hitPoints === 3) {'fullHP'); } else if (hitPoints === 2) {'twoHP'); } else if (hitPoints === 1) {'oneHP'); } else if (hitPoints === 0) {'Dead'); } } };
  23. Hi, I have been struggling with a minor issue, that I'm hoping someone can help me out with. I have a multiplayer game that uses Express and Socket io. When a new player logs into the game, the player walks to a certain location on screen. In order to make the player walk, I am drawing the player to canvas using a spirit map. In order to make the player walk per frame I am using the ctx.clearRect() to clear the previous frame, however doing this naturally clears the full canvas and removes the already logged player. I'm not sure how to work around this. Any insight is greatly appreciated. Thanks, Laura server.js Player.js
  24. Hi, My angular application is constantly changing these days because our team runs rapid updates right now. Because of cache, our clients do not always have the newest version of our code. So is there a way in angular to force the browser to clear cache? Thank You
  25. Preferred Language for Phaser?

    That is basically it guys. Which is your preferred language for phaser. If its other I don't know please write a comment.