Search the Community

Showing results for tags 'help'.

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
    • Pixi.js
    • Babylon.js
    • Panda.js
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 145 results

  1. Hello to everyone, I'm currently developing a fan-made, retro-style and non-profit game with Phaser based on the TV show Stranger Things. The main idea is to do a Point and Click game like old classics (Monkey Island saga, Indiana Jones and the fate of atlantis, etc...) with retro pixel-art graphics and chiptune music. I'm looking for GFX and Music artists If you are interested to collaborate with this project please contact with me and I'll send you a link to see the work in progress. (Sorry if there are some grammar errors, I'm Spanish).
  2. Hi everyone, I'm actually making a simple 2d platformer with arcade physic and I recently implemented a tiled tilemap which contain an "object layer". In this object layer I draw collision zone with the polyline tool. Now I want thoses "collision zones" to be recognized by phaser. Which mean : if the player overlap "object layer"'s content, it will blocked as if it was a wall. I just want to know if this is possible or if I must set collision "on" for my tile layers in which I may put all my walls tiles. Also, If I must use the 2nd solution, if my tile sprite is smaller than my 24x24 tile square (I attached an example), will the hitbox fit the sprite size or the 24x24 square ? Thanks beforehand.
  3. I'm trying to get a start in Phaser but there seems to be no way to create sprites of any form without having a server or doing development locally. I was hoping to be able to host all my games on jsfiddle. If I need a server would it also be possible to use simple shapes as sprites?
  4. In the game "Monster Wants Candy," I see this in the source code, and I was wondering why this was done. I've tried doing this myself but keep failing. This is what I mean: var Candy = {}; Candy.Boot = function(game){}; Candy.Boot.prototype = { preload: function(){ // preload the loading indicator first before anything else this.load.image('preloaderBar', 'img/loading-bar.png'); }, create: function(){ // set scale options this.input.maxPointers = 1; this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; this.scale.pageAlignHorizontally = true; this.scale.pageAlignVertically = true; this.scale.setScreenSize(true); // start the Preloader state this.state.start('Preloader'); } }; (source: var gameWidth = 800, gameHeight = 600; var game = new Phaser.Game(gameWidth, gameHeight, Phaser.AUTO), BootState = function () {}, gameOptions = { playSound: true, playMusic: true }, musicPlayer; BootState.prototype = { preload: function () {'loadingbar', 'assets/images/loadingbar.png');'logo', 'assets/images/logo2.png');'LoadState', 'js/gamestates/LoadState.js');'pollyfill', 'js/lib/pollyfill.js');'utils', 'js/lib/utils.js'); }, create: function () { game.renderer.renderSession.roundPixels = true; Phaser.Canvas.setImageRenderingCrisp(;'LoadState', LoadState);'LoadState'); } };'BootState', BootState);"BootState"); I also note that I don't take "Game" as an argument in my game state functions, unlike Monster Wants Candy which has the argument "game" in it's bootstate. Have I been doing something wrong? I'm following most of the tutorials and example code I've seen so far, though I am aware those may not always be good examples of best practice. Thanks in advance for replies and sorry for the long post. I'm a bit of a JS and Phaser noob, I'm mainly just aiming to learn good practice with this project.
  5. Camera and Sprite

    I have been working tirelessly with this and really struggling to get anywhere, if anyone can offer some form of assistance I would be greatly appreciative. I have essentially set up a reel of characters (staff) as sprites organised by co'ords in three circles, 12 characters per circle, around the camera set at (0,0,0), (Radius of circles are 1.5/1.45/1.4 I have a scene built currently which is super buggy in movement as well. I need it to when the mouse hovers on the left or right side of the screen to rotate the camera continuously scrolling through the images on loop (Cant get working past following the mouse - no loop - no smooth movement as mouse movement on y axis also rotates the camera. This is my mouse movement code: var mouse = {x:0,y:0}; var cameraMoves = {x:0,y:0,z:-0.1,move:false,speed:0.03}; function mouseMove(e){ mouse.x = e.clientX; mouse.y = e.clientY; camera.rotation.x += Math.max(Math.min((e.clientX - mouse.x) * 0.01, cameraMoves.speed), -cameraMoves.speed); camera.rotation.y += Math.max(Math.min((e.clientY - mouse.x) * 0.01, cameraMoves.speed), -cameraMoves.speed); The second main issue i'm having is that the sprites keep disappearing when rotating the camera, I'm trying to create a constant panable image reel from inside to view members of staff, there is an example i'm trying to follow and recreate found here: If anyone could tell me how to solve me mouse hover to move issue (with infinite looping) or a fix for the rendering of sprites issue it would be great! If anyone thinks they can help and needs any more code of any kinds just let me know and i''ll sort it! Thanks!
  6. How do I use the license when creating my games? I've read the license but I still don't understand what exactly I need to do to abide by the license. How should I do this?
  7. I'm using physics in one of my games, but I'm having trouble getting things to move realistically. I have the player (a bird), and I have objects in a group (trash). The trash I want to be very lightweight, so that it can be knocked around by the bird. Setting mass on both the player and the objects sometimes results in some weird visual stuff, so for now I have taken those lines out. What I really want to solve is the issue of friction. Right now, my code looks like this: this.trash.forEach(function (piece) { piece.anchor.setTo(0.5, 1); piece.body.gravity.y = 5; piece.body.moves = true; piece.body.velocity.setTo(100, 100); piece.body.collideWorldBounds = true; piece.body.bounce.set(0.8); piece.body.friction.x = 1; piece.body.drag.x = 1; }); The trash is gliding around on the floor of the game like wet ice cubes. I thought perhaps introducing another sprite to interact with would help: this.platforms = this.add.physicsGroup(); // Create the ground and set properties. this.platforms.create(0, game.height - 5, 'ground'); this.platforms.setAll('body.allowGravity', false); this.platforms.setAll('body.immovable', true); this.platforms.setAll('body.moves', false); this.platforms.setAll('body.velocity.x', 100); this.platforms.setAll('body.friction.x', 1); this.platforms.setAll('body.drag.x', 1); I'm still watching ice-cube trash. What I'm aiming for is something that can tumble (is there a way to get corresponding rotation on collision to happen?), so I want moving the trash to be more of a shove to move a distance rather than a tap from the player. Thank you for your help!
  8. How do i add health to a character

    I'm expanding the phaser tutorial game and i want to add health to the character plus use a plugin i found ( I understand nothing in the documentation and i'm clueless on how to add health.
  9. Particle emitter never turns on?

    Hi, everyone. I've not been able to find any similar issues to mine, so I'm posting a new topic asking for help. I'm using Phaser 2.6.2 to develop a multiplayer web game. I want a particle emitter to start at the location of the player when a button is pressed, in an explosion. In create(), I have the following code: this.emitter = game.add.emitter(0, 0, 8); this.emitter.makeParticles('seeds'); this.emitter.gravity = 500; I ask the emitter to start later in a custom function called dump(), passing in the player's coordinates. Dump() is called by a function when the variable appleEaten is true and the player is on the right part of the screen. dump: function (x, y) { appleEaten = false; this.emitter.x = x; this.emitter.y = y; console.log(this.emitter.maxParticles); this.emitter.start(true, 1000, null, 8, 8); console.log(this.emitter.x + ", " + this.emitter.y + " is the emitter."); console.log(this.emitter.on); // this is returning false? The program correctly knows how many particles it should spew (8). The emitter is at the correct coordinates based on another console log. However, this.emitter.on console log always returns false. I have the same console log line running in update, and of course it's false every time there, too. Basically, the emitter just doesn't turn on, and I don't know why. I am not getting any errors in the console, either. Has anyone run into this, and/or does anyone have a suggestion on how to approach this? Thank you! EDIT: I load 'seeds' in another state, as with all of my images. When I try to add 'seeds' as an image in create, nothing shows up, and again, no error. I imagine these are separate issues, but I could be wrong.
  10. Phaser + CocoonJS Lag Performance

    Hi in this states i uploaded my game is so laggy and i notice a bit of stopping after a platform leaves the viewport. It is a simple platformer game, hope you noticed this issue. THanks endlessState.js
  11. Help with animations!

    Hello! Im new here, and I'd like some help. I was coding, made a new spritesheet and tried making it play while I press a key. It doesn't seem to be working, and I don't know why. If you could help in any way, it'd be greatly appreciated. Thanks! CODE - SPRITESHEET -
  12. Hi Guys, I created this post hoping to find people interested in helping on the development and documentations of the unity toolkit. The unity editor allows to put an scene together very easy and export it all ,(lights cameras, meshes etc) with out a line of code How this works? Well @MackeyK24 started developing in visual studio the exporter tool and he saw a way to transform the camera , light or mesh from unity to babylon metadata, then later he add support for animations, splat maps painting, particles system and PBR materials, all of these trough the C# and the unity exporter. Furthermore, I join him on the project 6 months ago and I'm no as good as he is as developer but he took the time to show me and recorded videos to show people how to use it and improve it. I was not easy to pick it up if you dont have a strong object oriented programming skills winch most java script developer lack of, but this is an excellent way to learn or improve your coding skills So if you want to joins us and have some spare time to learn, please feel free to contact me, I can try to put you guys up to speed so we can continue with this great tool for development
  13. Hi, Everyone. this is my first game ( At least the one that got completed). I wanted to make some money out of it. Since this is my first game, I didn't have high hopes. But I got rejected by every sponsor I contacted ( I mean the few who replied). So, Anyone who can give me some pointer on how I can make this game or any future game that I'll be making better. please check out my game lolly match . Any feedback will be appreciated. Thanks in Advance.
  14. Character on the grounf

    Hey Community ! I'm currently using with Friends Phaser for the first time for a school project, and I need your help on 1 point. I'm using Dude as a character and blocks appear, but my problem is Dude can go out of the game Area and the game never restart :/ Any Idea ? Thanks a lot and sorry for my poor english <!doctype html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Phaser - Making your first game, part 1</title> <script type="text/javascript" src="js/phaser.min.js"></script> <style type="text/css"> body { margin: 100; } </style> </head> <body> <script type="text/javascript"> var game = new Phaser.Game(500, 500, Phaser.AUTO, '', { preload: preload, create: create, update: update }); var player; var platforms; var cursors; var stars; var score = 0; var scoreText; var sky; function preload() { game.load.image('sky', 'assets/sky.png'); game.load.image('ground', 'assets/pipe.png'); game.load.image('star', 'assets/star.png'); game.load.spritesheet('dude', 'assets/dude.png', 32, 48); } function create() { game.physics.startSystem(Phaser.Physics.ARCADE); sky = game.add.sprite(0,0, 'sky'); platforms =; var timer =, addRowOfPipes, this); // The player and its settings player = game.add.sprite(250, - 200, '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.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); cursors = game.input.keyboard.createCursorKeys(); } function update() { game.physics.arcade.collide(player, platforms); game.physics.arcade.collide(stars, platforms); game.physics.arcade.overlap(player, null, this); player.body.velocity.x = 0; if (cursors.left.isDown) { // Move to the left player.body.velocity.x = -250;'left'); } else if (cursors.right.isDown) { // Move to the right player.body.velocity.x = 250;'right'); } /* else if(cursors.down.isDown) { game.state.start(game.state.current); } */ else { // Stand still player.animations.stop(); player.frame = 4; } // Allow the player to jump if they are touching the ground. console.log(player.body); if (cursors.up.isDown || player.body.touching.collideWorldBounds) { game.state.start(game.state.current); } } function addOnePipe(x,y) { // Create a pipe at the position x and y var pipe = game.add.sprite(x, y, 'ground'); // Add the pipe to our previously created group this.platforms.add(pipe); // Enable physics on the pipe game.physics.arcade.enable(pipe); // Add velocity to the pipe to make it move down pipe.body.velocity.y = 150; // Automatically kill the pipe when it's no longer visible pipe.checkWorldBounds = true; pipe.outOfBoundsKill = true; pipe.body.immovable=true; } function addRowOfPipes() { // Randomly pick a number between 1 and 5 // This will be the hole position var hole = Math.floor(Math.random() * 5) + 1; // Add the 6 pipes // With one big hole at position 'hole' and 'hole + 1' for (var i = 0; i < 8; i++) if (i !== hole && i !== hole + 1) { addOnePipe(i * 60 + 10, 0); } } </script> </body> </html>
  15. Hi all. I'm having a weird problem with rotating sprites. When I use Canvas rendering it's fine, but with WebGL rendering, the edges are jagged when I rotate the sprite. The sprite is created from a texture that is made with PIXI.Texture.fromCanvas. I used the HTML-Canvas API to make the simple rectangle. Here's a code pen project that explains better: code. And here are attached pictures of WebGL rendering and Canvas-fallback rendering. Any help fixing this would be greatly appreciated
  16. TypeError

    Hello, I am pretty new to Phaser and also to JavaScript and while coding a game I keep on getting this error " TypeError: Argument 1 of CanvasRenderingContext2D.drawImage could not be converted to any of: HTMLImageElement, HTMLCanvasElement, HTMLVideoElement, ImageBitmap." I have been stuck on it for a day or so and I would like to see if someone could help me find where the problem is. I have been following a few tutorials i find on the web on how to work with Phaser and js here is a pastebin of the code.
  17. Hello, I'm very new to Javascript (and coding). I just finished my first game, a clone of Pong. I have it controlled via the mouse movement, now I'd like to add code that will let the user swipe up or down on a touchscreen and have that relate the to controls for the mouse. Any Help would be appreciated. Thanks in advance. Here is what I have for my mouse controls. window.onload = function() { canvas = document.getElementById('gameCanvas'); canvasContext = canvas.getContext('2d'); var framesPerSecond = 30; setInterval(function() { moveEverything (); drawEverything(); }, 1000/framesPerSecond); canvas.addEventListener('mousedown', handleMouseClick); canvas.addEventListener('mousemove', function(evt) { var mousePos = calculateMousePos(evt); paddle1Y = mousePos.y - (PADDLE_HEIGHT/2); }); } code help.tiff
  18. Hello, I have searched a solution for a problem for long time and didn't found, if someone have some ideas I am taking all x) did someone know if it's possible to rotate a group of bodies around an anchor point, I set some bodies for invisble walls and my objective is to turn them around by 90° around an anchor point, I know It must be not very comprehensive so I set up an Image to explain myself. In the screen, I have 2 bodies and I want them to turn around the red dot what must be my anchor point, I know it's impossible in arcade so I tried in P2 physics and impossible to found any solution :/ Thanks for reading, feel free to leave a feedback
  19. Sprite vs Image

    In the phaser docs I can see that the biggest difference between Sprite and Image is that you cannot animate or add a physics body to an Image, but in Image properties you can see an animationManager. I'm a little confused about this. Anyone?
  20. Hello: So I'm trying to make a bubble popping game where once the balloon pops it shows an animation before getting deleted off the screen. but I can't get the to work if it's in a different function, but once I place it in the create function it works fine so it's not a syntax error(i think). This is where I initialize the enemy playState.prototype.spawnEnemies = function(){ if (this.waveProperties.counter > 0) { while ( < this.waveProperties.max / 2) { var type = Phaser.ArrayUtils.getRandomItem(["enemyLarge", "enemyMed", "enemySmall"]); var enemy = this.enemies.create(null, null, enemyProperties[type].img); enemy.reset(game.rnd.integerInRange(80, 1400), game.rnd.integerInRange(50, 400)); enemy.anchor.setTo(0.5, 0.5); enemy.body.collideWorldBounds = true; enemy.body.bounce.set(1); enemy.body.allowGravity = false; enemy.animations.add('pop', [1,2,3,4,5],30,false); enemy.body.velocity.y = game.rnd.integerInRange(enemyProperties[type].minV, enemyProperties[type].maxV) * game.rnd.pick([-1, 1]); enemy.body.velocity.x = game.rnd.integerInRange(enemyProperties[type].minV, enemyProperties[type].maxV) * game.rnd.pick([-1, 1]); enemy.nextSize = enemyProperties[type].nextSize; enemy.hp = enemyProperties[type].hp; enemy.dmg = enemyProperties[type].dmg; enemy.points = enemyProperties[type].points; enemy.bubbleSfx ='bubbleSfx'); enemy.bubbleSfx.allowMultiple = true; this.waveProperties.counter -= enemyProperties[type].points; += enemyProperties[type].points; } } else { console.log("Next wave started.."); //add text that shows PREPARE FOR NEXT WAVE here. this.waveProperties.max *= 2; this.waveProperties.timeCheck += this.waveProperties.timeCheck; this.waveProperties.counter = this.waveProperties.max; } }; this is where it checks if the bullet collided with the enemy and if health is 0 it will play the animation then get destroyed playState.prototype.hitEnemy = function(bullet, enemy){ switch(bullet.key){ //checks which kind of weapon hit the enemy by looking at it's image name case 'bullet' : enemy.hp -= 10; break; } bullet.kill(); //bullet dies on impact if (enemy.hp <= 0) {'pop'); this.bEmitter.x = enemy.x; this.bEmitter.y = enemy.y;; this.bEmitter.start(true,2000,null,20); enemy.destroy(); this.splitEnemy(enemy.nextSize , enemy.x, enemy.y); -= enemy.points; } }; if anyone could help me it would be greatly appreciated I'm at a loss atm.
  21. I need help. I was following a tutorial online for the Phaser States, and I did everything right (I think), but obviously, I've made some changes myself to fit to what I kind of want. Here is the code: var loadState = { preload: function() { // Load the BG Images (Before so we can have an awesome looking loading screen) game.load.image('redPlanet', '././assets/images/redplanet.png'); game.load.image('spaceBG', '././assets/images/spaceBG.png'); // Preload the one character we need to look awesome! game.load.image('scavenger', '././assets/images/Scavenger.png'); // Add the loading label and the character, so the player doesn't think the game crashed. var background = game.add.sprite(0, 0, 'spaceBG'); background.scale.setTo(0.6); var character = game.add.sprite(80, 150, 'scavenger'); var loadingLabel = game.add.text(0, 0, 'Loading...', {font: '30px Courier', fill: '#fff'}); loadingLabel.alignTo(character, Phaser.RIGHT_CENTER, 16); // Load the Planet Images game.load.image('planet1', '././assets/images/Planet1.png'); game.load.image('planet2', '././assets/images/Planet2.png'); game.load.image('planet3', '././assets/images/Planet3.png'); game.load.image('planet4', '././assets/images/Planet4.png'); game.load.image('planet5', '././assets/images/Planet5.png'); game.load.image('planet6', '././assets/images/Planet6.png'); game.load.image('planet7', '././assets/images/Planet7.png'); game.load.image('planet8', '././assets/images/Planet8.png'); game.load.image('planet9', '././assets/images/Planet9.png'); game.load.image('planet10', '././assets/images/Planet10.png'); game.load.image('planet11', '././assets/images/Planet11.png'); game.load.image('planet12', '././assets/images/Planet12.png'); game.load.image('planet13', '././assets/images/Planet13.png'); game.load.image('planet14', '././assets/images/Planet14.png'); // Load the pause button game.load.image('pauseButton', '././assets/images/pauseButton.png'); } create: function() { game.state.start('menu'); } } And that is not all. Every single one of my state files has an error that says: Expected '}' to match '{' from line 1 and instead saw 'create'. Missing Semi-Colon. Unrecoverable Syntax Error (93% Scanned) Please help me, as this was going to be the way I made my game because I really like how organized states are!
  22. Alright. I'll cut to the chase. I'm making a simple game about abducting people, and I want the victims to run from the player or "flying saucer". This is what I have setup in the update function (I'm pretty sure the rest is irrelevant, but tell me if you need more): = game.physics.arcade.angleToXY(, -(this.player.x), -(this.player.y)); = game.physics.arcade.velocityFromAngle(, 145,;, 0, false); Now here is the error after getting to the "play" state (Oh and by the way, the game is based off of the state tutorial for phaser, except with a lot of edits and a lose.js file.): Uncaught TypeError: d.setTo is not a function at c.Physics.Arcade.velocityFromAngle (phaser.min.js:23) at Object.update (play.js:94) at c.StateManager.update (phaser.min.js:10) at c.Game.updateLogic (phaser.min.js:12) at c.Game.update (phaser.min.js:12) at c.RequestAnimationFrame.updateRAF (phaser.min.js:18) at window.requestAnimationFrame.forceSetTimeOut._onLoop (phaser.min.js:18) Please help!
  23. Hi! I was wondering if anyone would like to help me with the first steps of my 'little' proyect I'm a complete beginner to both phaser and game developing. I'm studying multimedia engineering so I am indeed familiar with HTML5, CSS, JavaScript, among some more scripting languages, but I've never tried implementing something as big as a game before- What I want to make is a virtual pet, (yeup. you read right), yet I intend to knock up the IA so the pet feels more natural, as well as some other features. It's basically an easily-expandable first proyect that I think will allow me to start with a very simple base and add layers of complexity as I get more experience. I chose to implement it using phaser and focus on a browser-game so It's easily accesible to the public and I can use the mobile phone for complementary actions in the long run- I still have no idea on how or what tools would be best to implement the user/pet database and gameServer. All I have right now, it's a simple, general and conceptual web-responsive layout and the empty major game states (menu, the room, etc), so my web looks like this: My major doubts are: 1. whether web-browser games usually work with this kind of layout or It'd be more beneficial to have the gamescreen (blue) covering the entirety of the viewport's size 2. Are the database and server coded first, or should I first focus on the different state's UI and work my way up to having the core mechanics roughfly implemented, then adding requests to the server? 3. I'd like to add some kind of system which allows me to read an external file, interpret it and place the game's dialog / calls for an event with the guide NPC / similar actions- something akin to what happens in some RPGs or in visual novels. I imagine this is done by designing my own 'dialog' structure in a JSON or XML file (which would be later on stored in my database for the client browser to download and cache) and parsing them? How it's this usually done? My apologies if what I'm asking is very basic stuff, I really don't know where nor how should I start. I've followed several 'make your first game' tutorials on phaser's website, but they're nowhere near as complex as to help me understand the general workflow in a multi-state + actors + connectivity proyect.
  24. Simple lines with Pixi.js

    Hi there folks! It's been a while since I posted something in here, glad to be back! I have a fair amount of experience in game development using JS Canvas, but recently I decided I had move on - so I went with Pixi. I figured out the basics of how to add sprites, do filters and such, but I just can't seem to figure out how to do simple lines and then manipulate them afterwards. What I mean is something like this: I noticed that PIXI.Graphics has an object attached to it called "graphicsData" in which I can find the points that make up the line - great - but when changing the value of these variables, nothing happens to the appearance of my line. I'd appreciate any help, as I'm quite new to Pixi Thank you!