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
    • 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 536 results

  1. This is more of a generic JavaScript question than a Phaser question, still I ask here because Phaser users must have best practices for this situation, probably better than generic JavaScript programmers would tell. To my dismay, I found out that my LD38 game doesn't work with Internet Explorer (gosh, I hate that browser, I always have to make special adjustments for IE compatibility – even if my game works great with every other browsers in existence, it will surely break somehow with IE). So what apparently causes the problem for IE now is something as simple and straightforward like the following class declarations: class Entity extends Phaser.Sprite { constructor(x, y, sprite) { super(game, x, y, sprite); this.anchor.setTo(.5,.5); } enablePhysics() { game.physics.arcade.enable(this); this.body.bounce.y = 0.2; this.body.bounce.x = 0.2; this.body.collideWorldBounds = true; } } class Player extends Entity { constructor(x, y, sprite) { super(x, y, sprite); this.lastmovetime = 0; } } class Gem extends Entity { constructor(x, y) { super(x, y, 'gem'); this.lastInteraction = 0; this.isActivated = false; } enablePhysics() { super.enablePhysics(); this.body.bounce.y = 0.75; this.body.bounce.x = 0.75; } activate() { this.isActivated = true; this.loadTexture('gem_active'); } deactivate() { this.isActivated = false; this.loadTexture('gem'); } } Google tells me that IE doesn't support this kind of class declaration, as it somehow needs to find a way to deviate from common sense. But then how am I supposed to declare classes? Is there a neat way that works with IE and other browsers as well? (Or maybe I should just show a warning that IE is not supported?) Any help or suggestion is appreciated.
  2. Hi All, I have 5 Html5 games developed using Phaser. kindly Suggest me some of the methods to make money using it, can i publish in webs or package it for IOS and Android. kindly help me
  3. Hi All, I'm a JavaScript developer with goods hands on experience on game development. I need artists to develop games for IOS ,Android and web. if any one intrested do Pm me.
  4. This is my first html5 game made with javascript. Usually I make games in flash, but lack of flash support across browsers forced to me learn new language. The hardest part was dealing with the fact that canvas turns everything into one big picture making object tracking that much more difficult. Needless to say I am extremely proud of the game even though it's short and simple, especially compared to some great stuff posted here. I made two games using the same code but just inserting different pictures into it. The game is size responsive and available on mobile as well since it's just javascript. It's not supported however by old browser versions such ie8 for example. Feedback will be greatly appreciated. First game - Messy House Second game - Office Chaos
  5. javascript

    I'm trying to make a quiz that sends you to a different page based on your answers, and I was wondering if it's possible to use conditionals to decide which page you'll be sent to. Is it?
  6. Hello! I am new in Webgl programming, and I am having trubel with moving the camera. I try to create a maze game, and I use three.js and box2D.js. The problem is that the camera is looking from above into the mazze, while I am trying to make it part of the maze (I mean looking like you are trying to escape from the maze). Could anyone, please, help me? I haven't found any ideeas on the web....
  7. var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, render: render }); function preload() { game.load.image('fon1', 'images/fon1.png', ); game.load.spritesheet('friends', 'images/friends.png', 153,82); game.load.spritesheet('public', 'images/public.png', 153,82); game.load.spritesheet('osebe', 'images/o sebe.png', 153,82); } function create() { //фон game.add.sprite(0,0,'fon1'); //кнопки buttonfriends = game.add.button(20,55,'friends',actionOnClickfriends,this,0,0,0); buttonpublic = game.add.button(340,55,'public',actionOnClickpublic,this,0,0,0); buttonosebe = game.add.button(560,55,'osebe',actionOnClickOsebe,this,0,0,0); } function actionOnClickfriends(){ } function actionOnClickpublic(){ } function actionOnClickOsebe(){ //here the code } function render(){ }
  8. I have this idea for creating a character customization system. The system would be implemented as follows. 1) Organize a base template sprite sheet with character components arranged in a composition for future compositing. Example: Lets assume a full body template for a characters design is 125 by 125 consisting of head, body, and leg components. The head component of the character would use 25 pixels and would be isolated on separate parts of the sprite sheet that occupies the respective pixels while the rest of the 100/125 pixels are blank. The same would be done for the body and leg components. 2) Bind the components together via some sort of linked list or maybe even graph based implementation. I'm still learning about graphs and am thinking they're best for this system given compositing more complex sprite sheets will involve layers. Any advised implementations or any kind of information on graphs associated with player creation systems is highly appreciated. I think this is a great opportunity to practice graphs. 3) Next there will be an interface that allows the player to choose the color and textures of each of these components. The player will confirm and submit their design when finished. Now that the player has submitted their design, I'm a bit puzzled about the next step and have a few ideas on composing the data. 4a) Use Phaser api to turn the data into bitmaps? I don't know much about this implementation yet since I'm still learning how to utilize bitmaps and how Phaser handles bitmaps 4b) Composite the items on a canvas and store it in a uri using the canvas to url method. I also lack experience with api but I definitely can see how it would work. 5) Ideally I'll save the data to a database and retrieve them via player credentials. I'm not sure if I'm over complicating things or not so any feedback would be appreciated. I use Phaser but any html5 based idea or solution should be fine.
  9. We would love to hear from any interested Game Developers to join our young studio. We are creating exciting games and offer huge opportunities for driven, experienced developers who want to work in an autonomous, creative, collaborative environment. Our culture is very unique - check out our careers page to get a feel for who we are : Or check out our "Javascript Developer with a passion for Games" vacancy to see if you might have the skills for this particular role: We can consider remote workers as well, or candidates outside the EU who wish to relocate to Malta or Barcelona. Feel free to drop me an email for more information: [email protected] High Five from the Unicorn Center!
  10. Hi guys, I want to share my game project that I have created in 2013. It was developed for 2 months but unable to finish it due to some unavoidable circumstances. Introducing Infinite Gears! Infinite Gears is an open-world, survival, 2D space-shooting, bullet-hell game (Whew!). As a Player, you can select a spaceship and start wandering through planets and destroy enemy motherships who are taking over those planets, while also fighting against some small enemies along the way. Each spaceship has its own power. One that focuses on pure power, one that focuses on single-target, and one that can protect itself from enemy attacks. As the Player saved a planet, Player can start buying upgrades so the ship gets stronger. The upgrade cost scraps you got from defeating an enemy. The scraps are then converted into GEARS to buy upgrades from the shop. There is an Overdrive (O.D.) bar that is generated by killing enemies. If this is triggered, it will grant you maximum power of that spaceship for a limited time. The enemies also get stronger as you go further away from where you start. This is indicated by the map on bottom right. There are sectors that are determined as levels to indicate that there will be more enemies and stronger enemy motherships. You must eliminate them as much as you can, and see how far you can go! The game should work on desktop browser at least IE9, Chrome, Firefox, and Opera. How to Play Clone or download this project, extract, and go to the project folder. Inside the ./bin folder, run the index.html. Use ASWD to move the spaceship. Use LMB (Left Mouse Button) to shoot. Use Space bar to throw off the bomb. Attack target is based on the mouse cursor. Last Note The game project was developed by Annobox (me and the illustrator) around June - July 2013 (2 months) for a competition and was still in development, but is no longer continued since then. This project is open to use for everyone, but for more detailed on the copyright notice, please visit the link and read the file. The development is discontinued until now, so there won't be any fix. JavaScript has changed so long since this project and I have my latest code been changed a lot since then, especially after ES6 gets global. So I hope you enjoy the game and the source code! Link to the Game
  11. Hey everyone, Sorry for that rookie question. I'm trying to develop this 1vs1 RPG multiplayer game and have a hard time implementing player matchmaking mechanism. For testing purposes, I'm creating a player when the client connects to the server. // Client side: const socket = io(); socket.on('connect', () => { socket.emit('create player', data => console.log(data)) }) // Server side: let players = []; const playerFactory = () => { return { state: 'idle', // idle, searching, fightInProgress lvl: getRandomArbitrary(1, 10), // Get random number from 1 - 10 winRatio: getRandomArbitrary(0, 100) } }; io.on('connection', socket => { socket.on('create player', fn => { console.log('Player created'); const player = playerFactory(name); =; players.push(player); //returning acknowledgement to client fn(player); }) }) Assuming there is a 'Find opponent' button. How do I watch and match players with 'searching' statuses and appropriate levels? Also, how would I match players by their win/loss ratio? Any information or code examples, libraries or frameworks would help a lot. Thank you in advance!
  12. Hi everyone, I just finished this little project that I call Room Walkers. You can play it here: In the top-left corner enter a name and click "Play!". Then a character will appear which you can control with arrow keys. When other players join you can see them and they can see you as well. There is no attacking or messaging in this game, just walking around. I used basic JavaScript Phaser with NodeJS "ws" library on the backend. Let me know what you guys think. woot.
  13. Hi all, first post, and a Pixi.js noob trying to learn the ropes - so please be gentle! First off, I'm a designer by trade ( - shameless plug) but I have dabbled in coding over the years mainly on a UI Development basis (AS3 Scaleform, Flash, C# Unity). A lot of my work at the moment is casino games, and we've been looking for a modern alternative for putting these together. Previously games would be made strictly in canvas using sprite sheets and keyframed animations for the most part. I've started using Spine for animations, which in turn has led us to Pixi.js as front runner for a renderer (with most mobiles now supporting webgl). Phaser looked attractive, but not sure it would offer the low level access the developers would need to hook into the backend. My role really is to get a prototype together in some form to showcase animations, get the frontend together and roll that onto future games as we learn the possibilities. Previously tried Animate CC but webgl offerings are seriously limited I think there atm, so thought it was time to get my hands dirty! Javascript is also pretty new to me to be honest, so trying to get my head around it at the moment. I've got a very basic game prototype together, using GSAP for transitions (which I'm already accustomed to), but still struggling on how best to split a game down into classes if this is possible? All the script is in one js file currently, and was wondering if it would be possible to take a more OOP approach? (Can tell I'm used to working in editors and attaching scripts to components etc). So for instance, I have a spin button in the game that has 4-5 functions for the state of the button. Would it be possible to split this down into a separate class just for this button, and have them communicate with the main game file? Similar scenario with a few functions I have for preloading webfonts (based on Just trying to lay things out the best I can before I end up with a mammoth js file! Know this maybe pretty basic javascript coding to some, but if there are any pointers, or tutorials out there that cover this side of things, it would be very greatly appreciated! Thanks in advance!
  14. I keep getting this Error: 'Phaser was used before it was defined' from running this Code: Please see attached all code and errors
  15. I create a group of objects and load a layer from Tiled. this.saws =; this.saws.enableBody = true;'saws', 4, 'saw', 0, true, false, this.saws); In update function, I set the rotation angle and I want the saw to rotate around its axis. this.saws.angle += 1; But a group of objects starts positioning relative to the origin and the saw starts to spin around (0, 0) and around its axis. How to make it stay in its original place? I just wanted to draw a level in Tiled, and assign certain behaviors to individual groups of objects: the saws rotate, the platforms move, etc. Demo
  16. Hello everyone! Just a quick question for you all. Sprites in my game are moving flawlessly when the game is played inside a browser window. However, once I switch to mobile webview, all the movements / animations become choppy. I have already set the following inside my game: game.forceSingleUpdate = true but nothing has changed. Is there any way I an optimize my game, or add something to make make my sprite move without lags? Thank you in advance!
  17. Hi, it's been a while since I've been in web development world, including HTML5 for games. I'm just wondering if I can finally use EcmaScript 6 features by default (class, let, const, extends, etc.)? How about you? If not, what are the transpilers that you can recommend me? Thanks
  18. Introduction: Hello, my name is Jack. I represent SymmetryGames as the lead 3D Artist, founder, and co-director of our current and very first game being developed as a studio. Currently, our studio is looking for a senior Javascript programmer. The following will describe more details about our studio, the game and the position we are hoping to fill. Game Info: Title: Z-Warz Genre: Zombie Survival Play Style: Top-Down Shooter Platform: Web-based browser MMO Graphics Style: 3D, Semi-realistic/cartoonish blend Game Engine: PlayCanvas, 3D Javascript Game Engine. (experience with this engine is not required) Server: Will be hosted on AWS Game Basic Description: A 3D IO game redesigned for zombie survival. Players get spawned in at random locations and must shoot zombies and build bases to survive. In this game, players will want to work together to survive rather than kill each other like most IO games, giving a fresh new look to standard IO games. With different classes, weapons, and buildable items, this creates a diverse game system with a lot of variation. Players will want to form teams, people of different classes and roles will work together, players will build bases and protect each other from hordes of different types of zombies. There are three Game Modes: Independent, Team, and Survival. Game Development Schedule: Currently, our studio is developing the prototype for Z-Warz. After we complete our prototype of the game, we will work for 1-4 weeks on our Kickstarter video and other Kickstarter related topics. After that is complete, we will launch our Kickstarter Campaign for $38,000 U.S. Dollars, however, some calculations are still being made so that number may fluctuate. After our Kickstarter campaign has finished, we will begin the first week of development by establishing payment systems for employees, purchasing the needed software, and preparing other important assets. After the first week, we will have 12 weeks exactly to develop the full Z-Warz game. An additional 1-2 months after development will be used for beta testing/corrections and marketing. After our games initial release, all employees will receive 2-3% of the game's ad based revenue for the first initial 2-3 months. About the job: Currently, we are looking specifically for a Javascript Programmer. If you happen to have experience with the PlayCanvas Engine, that will be noted. We are looking for someone who specifically finds an interest in developing games similar to ours. The programmer should have a strong understanding of the Javascript fundamentals. Alongside our other developer, you would work to develop player movement, character AI, combat systems, a building system, a player class system, and more. The PlayCanvas game engine handles most of the rendering systems. The Javascript programmer will be expected to work roughly 15-20 hours per week during the 12 weeks of development. Aside from royalties, this job pays an hourly wage of 20 USD. Please understand that as an Indie Startup studio, we are unable to pay large amounts per person. If you choose to help work with us on our prototype before the Kickstarter/official development phase, please note we will not be able to pay at that time, however, higher amounts royalties will be offered to those interested. Application: To apply for the position as Senior Javascript Programmer, please email me directly here: [email protected] Please provide some basic information about yourself, as well as any work you have done in Javascript that you feel expresses your talent as a programmer. This job posting has been made short and to the point. If we missed any big questions, please feel free to ask anything in your application for this job, or below in the comments. Thank you for your time, - Jack (SymmetryGames Founder and Lead 3D Artist)
  19. Hey there, So I've snagged onto a little problem while developing my game. I'm using Phaser with it's inbuilt support of gamepad. The axis of the controller input works in a way such that it returns 1 when held to the right and -1 when held to the left. Here's a picture to make things easier to understand. How would I map the values to degrees? Here's a visual representation of what I'd like to get. What's a formula that would allow me to do this?
  20. Hello everybody! I hope you are having a fantastic day! Our team wants to start making simple HTML5 games for our Android / IOS apps. Games are supposed to be ran inside the WebView. We are looking for a very lightweight engine, because there is already ads placed at the bottom of the screen in our apps. Our first attempt was Phaser.js, but the performance wasn't the greatest inside the WebView. Choppy sprite movements, common fps drops and so on. If you guys know an engine that could help us achieve the goal, please let me know! Thank you in advance!
  21. Hello everyone, my name is Sascha and I'm developing websites and games. Here on this thread I want to offer you some of my games. (step by step), if you are interested in one game, please contact me on [email protected] All is possible, just to buy a single-use license, a single-use license with you're brand, a exclusive license (if not sold in another way until the request comes in), to buy the source code or graphic templates. Just contact me, I'm openminded for a lot of ways. The games offered in this thread are build with javascript and the frameworks jQuery and Pathfinder (1920x1080 | scaleable and fullscreen possible):
  22. Hi, sorry for very noobish question I have my phaser game.js file which have reached more than 700 lines of code. I want to divide it into documents containing f.e. only create function, update, variables and other functions. I thought this will work: <div id="game"> <script type="text/javascript" src="game.js"></script> <script type="text/javascript" src="create.js"></script> <script type="text/javascript" src="update.js"></script> <script type="text/javascript" src="functions.js"></script> </div> But error, create function not found. In game.js it look like this: var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render: render }); function preload() { (...) } function create() { (...) } function update() { (...) } functions....
  23. Hello everybody! I hope you are having a great day! I have recently build a prototype for my new phaser.js game. It's a simple runner where the player has to avoid obstacles. I have tested it in multiple environments, including mobile browsers and webviews. The game refuses to run smoothly like I want it to. I have experienced lags, loosing frame rate and total unresponsiveness. So here I am, begging for your help and advice, what am I doing wrong? How can I make my game run smoothly? Is my update loop simple enough? Anything help guys! Here is the source Play it here (don't forget to switch to a mobile view) Thank you in advance! This community is awesome
  24. Hello I can't play phaser animation through getting of constructor new Animation(game, parent, name, frameData, frames, frameRate, loop, loop). Before adding an instance of class new Animation all work, and just sprite is showing, but after adding animation it is ceasing to work. I spent a lot of time for realization, but without results. What is the problem? My classes for sprite animation: mainPlayer.js: import 'phaser-shim'; export default class extends Phaser.Sprite { constructor ({ game, x, y, asset }) { super(game, x, y, asset) this.anchor.setTo(0.5); this.outOfBoundsKill = true; this.scale.setTo(0.8);// scale this.angle = 90; game.physics.enable(this, Phaser.Physics.ARCADE); } update () { } } My mainPlayerAnimation.js: import 'phaser-shim'; export default class extends Phaser.Ainmation { constructor ({ game, parent, name, frameData, frames, frameRate, loopFirst, loopSecond }) { super(game, parent, name, frameData, frames, frameRate, loopFirst, loopSecond); //this.anchor.setTo(0.5); //this.outOfBoundsKill = true; //this.scale.setTo(0.8);// scale //this.angle = 90; //game.physics.enable(this, Phaser.Physics.ARCADE); } update () { } } My level class: import 'phaser-shim'; import config from '../config'; import currentGameState from '../currentGameState'; import backgroundMainGame from '../objects/backgroundFirstlevel'; import mainPlayer from '../objects/mainPlayer'; import mainPlayerAnimation from '../objects/mainPlayerAnimation' import bullets from '../objects/bullets'; import enemiesloader from '../loaders/enemiesloader'; import bossloader from '../loaders/bossloader'; export default class extends Phaser.State { preload () { this.load.image('background', './img/firstlevel.jpeg'); this.load.spritesheet('mainPlayer', './img/main.png', 50, 50); this.load.image('bullet', './img/shot.png'); this.load.image('enemy', './img/enemy.png'); } create () { //--------------------------------------------------------------- this.background = new backgroundMainGame({ game: this, x: 0, y: 0, width: 1024, height: 768, asset: 'background' });; //--------------------------------------------------------------- this.mainPlayer = new mainPlayer({ game: this, x:, y:, asset: 'mainPlayer' });; //--------------------------------------------------------------- this.mainPlayerAnimation = new mainPlayerAnimation({ game: this, parent: this.mainPlayer, name: 'mainPlayerAnimation', frameData: null, frames: [0, 1, 2], frameRate: 100, loopFirst: true, loopSecond: true }); //--------------------------------------------------------------- this.bullets = new bullets({ game: this, parent: null, name: 'bull', addToStage: true, enableBody: true, physicsBodyType: Phaser.Physics.ARCADE });; //-------------------------score--------------------------------- this.scoreText = this.add.text( config.gameWidth-200, config.gameHeight - 50, `score: ${currentGameState.score}`, { font: '32px Arial', fill: '#dddddd'}); this.scoreText.anchor.setTo(0.5); //--------------------------------------------------------------- this.cursors = this.input.keyboard.createCursorKeys(); this.fireButton =; } update () { //--------------------------update score------------------------------ this.scoreText.text = `score: ${currentGameState.score}`; //--------------------------if press nothing stop the ship------------ this.mainPlayer.body.velocity.x = 0; this.mainPlayer.body.velocity.y = 0; //------------------------spawn enemies------------------------------------- enemiesloader(this); //---------------------spawn boss------------------------------------------ bossloader(this); //-------------------------controls---------------------------------------- if(this.cursors.left.isDown){ this.mainPlayer.body.velocity.x = -350; } if(this.cursors.right.isDown){ this.mainPlayer.body.velocity.x = 350; } if(this.cursors.up.isDown){ this.mainPlayer.body.velocity.y = -350; } if(this.cursors.down.isDown){ this.mainPlayer.body.velocity.y = 350; } if(this.fireButton.isDown){; } } }
  25. How can I create start menu in Phaser? I found nothing on that.