Search the Community

Showing results for tags 'javascript'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • 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

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 658 results

  1. Hey All, I'm using WebPack to build my game and I've run into a scoping issue. I'll try and explain. Below is my TestScene scene/class. import 'phaser'; import Npcs from 'modules/Npcs.js'; const npcs = new Npcs() export class TestScene extends Phaser.Scene { constructor () { super('TestScene') } preload(){...} create(){ this.physics.add.collider( this.player, this.bombs, npcs.hitBomb, null, this ) } } Below is my npcs class import 'phaser'; const gameplayStates = new GameplayStates() export default class Npcs { hitBomb (player, bomb) { this.physics.pause(); player.setTint(0xff0000); this.entityDestroy() } entityDestroy () { console.log('destroyed') } } `this.player` and `this.bombs` are in place and work as expected in every way I intended. The callback in the collider method has `this`(testScene) as the context so, `this.entityDestroy()` no longer seems to work and fires app.bundle.js:116068 Uncaught TypeError: this.entityDestroy is not a function I suspect this is because the `npcs` class is not in the npcs class' scope when the method is called from the collider function. How can I get around this with the collider method? Your help would be much appreciated. Thanks all, Your help is much appreciatd.
  2. sammae

    Create a moving platform

    Hi, I've been stumped by this for quite awhile and I feel as if it's so simple. I'm simply trying to create a platform that moves back and forth that a player can jump on. I got a platform to move by doing something like this: platform = this.physics.add.sprite(300, 100, 'form'); platform.body.allowGravity = false; platform.body.immovable = true; platform.body.velocity.x = 100; But it just keeps moving in one direction and I can't figure out how to make it collide with the player. I tried the: this.physics.add.collider(this.player, platform); But that did not work. I just want a simple platform that moves back and forth that the player can jump on. Please any help is greatly appreciated, I'm ready to pull my hair out over this. 😞
  3. JackFalcon

    BabylonJS on STEAM -> BOXiGON~V1

    Hello awesome HTML5Dev community... NEWS-FLASH: BABYLONJS is on STEAM!!! To show appreciation for BABYLONJS and HTML5GAMEDEVS here is a look at the "Special Thanks" in the credits: The game is called BOXiGON~V1, on STEAM: https://store.steampowered.com/app/842490/BOXiGON/ We look forward to giving back to the community with tips to support others in the SAME-QUEST! So, in a few weeks, we'll post a retrospective: How To Get Your BABYLONJS App on STEAM. As documentation of the mix of tools, the steps, and best-practices we used. Also, we will PR LINK for BABYLONJS.com, and later this quarter, convert the ElectronJS app into FREE WEB DEMO. Where anyone can see the code and kick the tires. Are you a source contributor and would like to add your name to credits? We would love that! Or if you are listed above and would like a name or handle change? Just let us know. LAST, we care what you think. So drop us a note! There are many more steps, as you probably know, and we hope for a couple more BOXiGON's on different platforms next year. V2 is in the works and we are just getting started! See you around. Congratulations BABYLONJS and Thank you, ~BOXiGON-TEAM-.
  4. Hi, I'm wondering how to avoid simultaneous mousedown events. I have a canvas drawn on screen. When a player clicks events take place based on where the player clicked on the screen. If two players click the canvas at the exact same time, they should both be alerted with a message that no simultaneous moves are allowed. I used an array to capture the move, however it seems to only register the move after the check and not before. Is there a simple way to capture which clients clicked at the same time? //Listen for player click event chainlinks.onmousedown = function(event) { var totCT; //update current player turn on client for (var i = 0; i < remotePlayers.length; i++) { if (remotePlayers[i].id == socket.id) { remotePlayers[i].currentTurn = true; } } //update current player turn on server for (var i in cPlayers) { if (cPlayers[i].id == socket.id){ cPlayers[i].currentTurn = true; } } socket.emit('update-currentTurn', {remotePlayers: remotePlayers, cPlayers:cPlayers}); if (totCT > 1) { //Simultaneous move happened - show invalid message } else { //All good to go ahead with the click event } } Thanks!
  5. grelf

    New free game: The Forest

    New free game: The Forest See https://www.myforest.uk and documentation at https://www.grelf.net/ojsvg.html This is a redevelopment in HTML5/JavaScript combining two much earlier programs, "The Forest" and "Explorer", which I wrote and had published in the 1980s for the TRS-80, Sinclair Spectrum and BBC Micro. It is partly a simulation of the sport of orienteering and an aid to interpreting contour maps but there are several diversions for non-orienteers, including a challenging treasure hunt. It is set in a vast forest, effectively infinite. This rewrite demonstrates how powerful the HTML5/JavaScript platform can be. Detailed maps and complicated scenes are displayed in fractions of a second. The program should run on any device that has a browser, from desktop PC to smartphone; it works on my cheap Android phone even in battery-saver mode. A friend tells me it works on her Kindle tablet. Older devices may not be fast enough though. Despite the huge extent of the terrain, the game downloads and runs in seconds because the program is only about 120 kilobytes (yes, kilo!). And there is nothing to install. I do not use any third party libraries. I deliberately use only the basic 2D graphics context because others, such as WebGL, are not available on all devices. Please feed back to me (gr at grelf dot net) details of any device that you find it doesn't work on. Tell me make and model, and particularly the operating system and browser (with version), and what doesn't work. The program and its source are freely available, uncompressed, because I want to encourage others to program creatively on the HTML5/JavaScript platform. I am writing on my personal web site about how it works. Lots of background information can be found at https://www.grelf.net/ojsvg.html and other pages linked from there, including my free JavaScript course. I think HTML5/JavaScript is a good combination for rewriting retro games and making them available to all, rather than emulating the cumbersome old machines in software or physically reproducing them, as some are doing. Reprogramming is more work of course but it can be very satisfying (and JavaScript is much easier to write than assembler). The technology now makes it possible to write what I really had in mind back in the 80s.
  6. Hey, I got a lot of ES6 classes for my game, so I use a factory, that is hooked into phaser as a plugin. Complete code below. However when I do 'const PLAYER = this.add.player(x,y);' it does not return the player object and the constant PLAYER is null. Can someone help me out here? What am I missing? class ObjectFactory extends Phaser.Plugins.BasePlugin { constructor(pluginManager) { super(pluginManager); pluginManager.registerGameObject('player', this.createPlayer); pluginManager.registerGameObject('overlay', this.createOverlay); } createPlayer(x, y) { return this.displayList.add(new Player({ scene: this.scene, x: x, y: y })); } createOverlay(x, y, w, h) { return this.displayList.add(new Overlay({ scene: this.scene, x: x, y: y, w: w, h: h })); } } Plugin config: plugins: { global: [ { key: 'Factory', plugin: ObjectFactory, start: true } ] }, cheers
  7. I have created a platform game in 2D for the desktop that is based on the Classic Space theme by LEGO. It is still under testing so I will make a new post later on when it is finished, but here is a little preview of the game. It is written from scratch in Javascript without using any libraries (except for jQuery sometimes), and since it is quite big it probably takes more then 5 hours to finish. In total there are 6 bosses and about 50 different enemies. The graphical style is a mix between Nintendo 8-bit and C64. I also wonder if you got any tips on how I can spread this game to a bigger audience?
  8. SOFTGAMES is looking for an experienced Game Developer - JavaScript / HTML5 who is goal-orientated and a strong team player. Join a team of super experienced people to build great games for Messengers that will entertain tens of millions of people around the world every month. You design, architect, test and implement game features into our live games. Further you'll work on upcoming Messenger Games from the scratch until global release and during post-launch. You will collaborate with producers, game artists and with other HTML5 Game Developers to share learning and best practices. You are passionate, ship robust and high-performance code, and act as a fount of knowledge when it comes to game development. As part of a small, high experienced and dynamic team you will enjoy a creative, challenging and collaborative environment. Your role… Develop HTML5 games for Facebook Messenger to expand our portfolio, with Pixi.js Maintain and optimize game features Write robust code to be used by millions of users Work on schedule, set clear goals Independently create complete solutions from scratch Share knowledge and help colleagues Your profile… Great passion for game programming 3+ years of professional software engineering experience Deep knowledge of: Pixi.js JavaScript / HTML5 As a plus: Phaser, TypeScript, Webpack, Reactjs, Node.js Shipped at least 2 mobile/social title, preferably on multiple platforms Ability to quickly get up to speed with existing code Deliver high-quality and well-structured code Open-minded and keen to learn Check out Cookie Crush on Facebook Messenger. Can you build this game? We offer… A spirited, inspiring, international and enthusiastic team The best and brightest company in producing and distributing Messenger Games The chance to craft games for millions of monthly gamers Valuable insights into global expansion, start-up scene and entrepreneurship Flexible working-hours and flat company hierarchy Inspiring company breakfasts, epic team events Perks: fresh fruits, cold drinks, tee, coffee, discounted local transport ticket, health package, lunch vouchers, maternity leave etc. About SOFTGAMES… Based in Berlin, the creative capital of Europe, SOFTGAMES together with its ROFL brand is the leading developer of games for Facebook Messenger and the developer behind popular titles like Cookie Crush, Solitaire Story, Candy Rain or Fish Story. Further SOFTGAMES is operating the world’s largest platform for HTML5 games distribution and monetization outside the Messengers. We’re delivering fun to tens of millions of players every month across 6 continents on the device of their choosing. Our vision is to help users to instantly discover and engage with games they like, while helping brands to reach their target audiences. Have we caught your interest? Then we look forward to your detailed application here: https://softgames.recruitee.com/o/game-developer-javascript-html5
  9. Hello! We have been working on a blockchain game development solution aimed at eliminating unfairness in the gambling industry. A couple of weeks ago we have released our SDK, and we are now looking for a game developer to collaborate with on developing a game with our kit and producing a video tutorial series about the whole process. Our in-house developers will support you along the way and provide you with all of the necessary information. Some requirements: You are a native English speaker You have experience in video editing An established audience on YouTube or Twitch is a plus, but not necessary We're ready to discuss a reward and a payment method that will be the most convenient for you. If this sounds like something you would like to work on, please send us a PM or an email with your portfolio and a link to your channel at max@dao.casino
  10. Hi guys, in the release of phaser 3.13, the developers of phaser have said that the support of scale manager and dom elements will be available in the phaser's 3.14 release, but after release we see that these functionalities are not available for us for now ? So who can say when it will be available and is there another option to solve problems related to adding dom elements and scaling.
  11. We’re looking for JavaScript experts in gaming to work in any of our locations, like Tokyo or Mountain View. Game Closure is building technology to author and distribute HTML5 games on messenger platforms. Feel free to send me an email at rachel@gameclosure.com to learn more! www.gameclosure.com
  12. hi I need help to fix a bug on mobile for a phaser game. it works on the PC (Browser) but not on mobile browser. thanks
  13. Calling all HTML5 game developers! Here at Goodboy Digital we are looking for developers with a passion for HTML5 game making to come and join a team who really love what they do. If you want to kick out some of the best HTML5 games going with us and help work on cool R&D projects like Pixi.js (and some secret ones too!) then please apply and show us what you got We are looking for all skill ranges from junior to senior. The main thing is that you love making these things! Junior Developer - https://goodboydigital.workable.com/j/5C5E976940 Senior Developer - https://goodboydigital.workable.com/j/30B8771D24 Cheers Mat
  14. Hi, I have a nodjs application that is currently saved in Windows 2012 R2 server using IISnode with IIS 8.5. I am getting a 404 File or directory not found error, however nothing is being recorded in the error logs. When I run this locally I have no issues and the game runs well. Thinking it could be a permissions issue, I decided to provide temporary read/write access, however that didn't seem to make a difference. I also confirmed that the links are all correct in terms of where files are sitting. Here is my server side code: var PORT = process.env.PORT || 8080; var express = require('express'); var app = express(); var http = require('http'); var path = require('path'); var util = require("util"); var server = require('http').createServer(app); var compression = require('compression'); //Get required classes xyLocation = require("./xyLocation").xyLocation; app.use(compression()); //Compress all routes app.use('/client', express.static(__dirname + '/client')); app.use('/js', express.static(__dirname + '/js')); app.use('/css', express.static(__dirname + '/css')); app.use('/sounds', express.static(__dirname + '/sounds')); app.use('/images', express.static(__dirname + '/images')); // Routing app.get('/', function(request, response) { response.sendFile(path.join(__dirname, 'index.html')); }); server.listen(PORT); console.log('Starting server on port '+ PORT); var io = require('socket.io')(server,{}); io.sockets.on('connection', function(socket) { ... Thanks MLA
  15. Pankaj Singh

    Html5 Game Developer

    Hi Guys, We have urgent requirement for Html5 Game Developer for Slot Game Technical Skills: • HTML5, createjs and Javascript expertise for Desktop/Mobile games • Canvas- programming (Multi Layer). • WebGL API for 3D graphics and animation. • Mobile events and device orientation. • Performance optimization techniques and run time performance improvements on mobile devices. • Ajax, Websockets & Web Workers, I/O, NodeJS and server-sent events. Kindly share your portfolio link and resume on this email- pankaj.singh@progaindia.com Thanks Pankaj Singh
  16. Hi, I have a Phaser canvas and must connect it to HTML in which it is in. Lets say I have a function var game;window.onload = function() { game = new Phaser.Game(550, 700, Phaser.AUTO, 'phaser_canvas', { preload: preload, create: create }); function phaserFunction(){ // do something }}and I have a function in the HTML container, like a selector <select id="my-selector" onchange="game.phaserFunction()"> <option> anOption</option> <option> anOption</option> </select>and this is not triggering the function inside Phaser code. How can I call the function inside Phaser from outside? I tried using game.functionName() but it doesnt work with selector Thanks!
  17. Nonostante Games

    BIOK - A strategy board game of conquests

    Hi, I'm so happy to introduce you BIOK! BRIEF DESCRIPTION BIOK is pure strategy and intuition. A board game for the ingenious and the acute minds. Lead the creatures on the playing field to capture monsters and all kinds of items. Watch the monsters’ eyes and guide them to their preys. KEY FEATURES - Simple controls and fluid mechanics, super simple to understand and fun to use - 60 levels in many worlds with various maps - 10 creatures with different characteristics and abilities - Bonus and survival mode to solve puzzles and challenges - Special objects and environmental elements - Secondary missions and hidden objectives iOS - AVAILABLE Get BIOK from the Apple App Store ANDROID/WINDOWS - BETA You can access the beta: BETA ACCESS (remember to use your google account) MORE ABOUT BIOK You can read more about on the official BIOK game page. FOLLOW US Send us any commend and advice. Help us to make a better game. Facebook | Twitter | Web
  18. gsknbabu

    Infinite Scroll

    Hi, I want to allow the user to either scroll to document bound borders endlessly i.e Infinitely drag on the canvas. Please help!!! Ex: A canvas created with 1000*1000. And Enabled PAN and Zoom on the canvas. Draw a rectangle on the canvas and move the rectangle with mouse to the edge of the boundaries( top,right, bottom, left) it should scroll the the rectangle to the end of the canvas. Right now my issue is I can drag the rectangle till the browser boundaries. I need to allow the rectangle to drag beyond the content so that I can use the full canvas. I can PAN the canvas to move around the browser. Please refer the link https://gojs.net/latest/samples/scrollModes.html where user can start dragging the rectangle to the boundaries, scrolls automatically towards the mouse pointer. Thanks, Naveen.
  19. I want to make my own web card game, but I'm a starter in the code world, so, I need tips to choose the right JS framework. Please.
  20. ijonatron

    Entity interpolation with Pixi.js

    Hey everyone! Just joined this forum hoping someone could help me out here... I'm working on a test project to try out some of these concepts. I'm currently working on entity interpolation and I think I'm pretty close to it working, but the moving objects still seem jittery. On the back end I'm sending snapshots of player positions every 50ms... // send snapshots setInterval(() => { const snapshot = { timestamp: Date.now(), players }; ws.clients.forEach(client => { client.send(pack('snapshot', snapshot)); }); }, 50); These snapshots are being received on the client like so... const sync = snapshot => { // keep the last 2 snapshots if (snapshots.length === 2) snapshots.shift(); snapshots.push(snapshot); snapshot.players.forEach(player => { let manager = playerManagers.find(mngr => mngr.id === player.id); ... manager.updateRemote(player); }); t = 0; }; The manager here is a class instance associated with each player that controls the sprite's position, rotation, etc. Here is that updateRemote method... updateRemote = player => { this.local = this.remote ? this.remote : player; this.remote = player; } What this does is set the manager's local and remote properties. These are the states that the sprite should interpolate between. Then here is the Pixi.js ticker... let t = 0; ticker.add(() => { t += ticker.deltaTime; let lag = 50; if (snapshots.length >= 2) lag = snapshots[1].timestamp - snapshots[0].timestamp; playerManagers.forEach(manager => manager.interpolate(t / lag)); }); Here I am increasing t by the ticker's deltaTime and dividing that by the time between the two snapshots (or the intended time if there aren't two snapshots available). Remember above that t is reset each time a snapshot is received. This means when a snapshot was just received, t will be 0 and start counting up. When another snapshot is received, t will be at 50 (or whatever the real lag is) then be set back to 0 and repeat. In other words, t / lag will be between 0 and 1 for the lerp function... Here is that interpolate method... interpolate = delta => { this.sprite.position.set( lerp(this.local.pos.x, this.remote.pos.x, delta), lerp(this.local.pos.y, this.remote.pos.y, delta), ); this.sprite.rotation = lerp(this.local.direction, this.remote.direction, delta); } And the lerp function is the second formula here. AFAIK this should give me smooth movement between the past snapshot (local) and the new one (remote), but movement still seems choppy and jittery. I'm fairly new to interpolation, prediction, and other game networking concepts so hopefully someone can help me out here. Please let me know if any more information is needed.
  21. Some time ago I started my own twitch channel where I have been working at 2D space massive multiplayer game development. I try to utilise my roadmap task by task, telling about what I'm doing. I have using javascript, node.js and top-notch technologies such as service workers, websockets, server-side rendering, webgl and famous libraries & frameworks like React, Webpack, Koa. And finally the question, does anybody interested in watching Twitch to improve their skills in gamedev and programming based on real game projects? I'm free to welcome other developers, answer for any technical questions. For me it's basically chance to meet new developers, increase of motivation, extra opportunity to find anyone who can help me in gamedev as well. Thank you!
  22. ItsYaBoiWesley

    CreateJS Noob - Problem with my Sprite class

    Hi! I'm an experienced programmer with C++, but just getting started with JavaScript. I'm making a simple 2D game to get started. I'm using the CreateJS library to do my image/spritesheet manipulation. Right now, I'm trying to create a Sprite class, which will set up a spritesheet in the constructor, and draw the sprite with coordinates in the draw() function. (a member of my Sprite class) Anyways, I'm doing some debugging now. My program stops in the constructor of my Sprite class, and I can't figure out why. To anyone with CreateJS experience, what is wrong with my constructor function?!?!?! Thanks! class Sprite { constructor(src, frameWidth, frameHeight) { window.alert("DEBUG constructor. " + src + ", " + frameWidth + ", " + frameHeight); //Gets here this.spriteSheet = new createjs.SpriteSheet({ images: [queue.getResult(src)], frames: {width: frameWidth, height: frameHeight}, animations: { ani: [0,4] } }); window.alert("DEBUG end constructor"); //Never gets here } draw(x, y) { animation = new createjs.Sprite(this.spriteSheet, "ani"); animation.regX = 99; animation.regY = 58; animation.x = enemyXPos; animation.y = enemyYPos; animation.gotoAndPlay("ani"); stage.addChildAt(animation,1); } }
  23. Hello, I apologize in advance if my English is not perfect, I'm French. I've recently created a 2D brick breaker game from scratch in JavaScript (Typescript) and HTML5 Canvas, named Save the koala. I've created 7 different levels for now, and I would have liked to have some feedback to give me some improvement on this game 🙂 I think I will create multiple worlds, and other levels if the site knows a minimum of traffic. From a general point of view, how do you find this game? You can find my brick breaker game here. The website is in French, so I give you the controls here : - If you have a keyboard press Enter to play, and the arrow keys to move. - If you are on a tactile device, there are 3 buttons on the screen to play, pause and move. Thanks to those who will take the time to test and answer me 🙂
  24. We're creating interactive product experiences with Babylon and need to expand our team. Our two offices are in Gothenburg, Sweden and Warsaw, Poland. If you're close, all the better. This summer we're working on a project for a big tool company and need to beef up our team. We'll begin with a freelance engagement but we're looking for a more stable relationship in the long run. I'm not going to specify what we expect in terms of your skills, except you'll need to know your way around Babylon and be good at TypeScript / JavaScript. If you want to know more, please PM me or mail me at thomas [a] spook [dot] se .
  25. scope2229

    Cant get player to display

    I've been using this post Player.js To try and separate my code but i'm failing to understand really how it works. var Player = new Phaser.Class({ Extends: Phaser.GameObjects.Image, initialize: function Player(scene, x, y){ Phaser.GameObjects.Image.call(this, scene); this.speed = 160; }, create: function(){ player = this.physics.add.sprite(32, config.height - 150, "ship"); player.setCollideWorldBounds(true); cursors = this.input.keyboard.createCursorKeys(); }, update: function(){ player.setVelocity(0,0); if (cursors.left.isDown){ player.setVelocityX(-this.speed); } else if (cursors.right.isDown){ player.setVelocityX(160); } else{ player.setVelocityX(0); } if (cursors.up.isDown){ player.setVelocityY(-150); } else if (cursors.down.isDown){ player.setVelocityY(+150); } } }); then i call the player in lvl1.js var lvl1State = new Phaser.Class({ Extends: Phaser.Scene, initialize: function lvl1(){ Phaser.Scene.call(this, {key:"lvl1"}); }, create: function(){ this.starfield = this.add.tileSprite(400,300,800,4000, 'starfield'); this.juststars = this.add.tileSprite(400,300,800,4000, 'juststars'); this.nebula1 = this.add.tileSprite(400,300,800,4000, 'nebula1'); this.stars2 = this.add.tileSprite(400,300,800,4000, 'juststars'); this.nebula2 = this.add.tileSprite(400,300,2000,4000, 'nebula2'); this.createStarfield(); //add player this.player = new Player(this.game, 0, 0); this.game.add.existing(this.player); },//end of create update: function(){ this.starfieldEffects(); },//end of update //-------GLOBAL FUNCTIONS-----// createStarfield: function(){ this.starfield = this.add.tileSprite(400,300,800,4000, 'starfield'); this.juststars = this.add.tileSprite(400,300,800,4000, 'juststars'); this.nebula1 = this.add.tileSprite(400,300,800,4000, 'nebula1'); this.stars2 = this.add.tileSprite(400,300,800,4000, 'juststars'); this.nebula2 = this.add.tileSprite(400,300,2000,4000, 'nebula2'); }, starfieldEffects: function(){ this.starfield.y += 0.5; this.juststars.y += 0.2; this.stars2.y += 3.8; this.nebula1.y += 0.8; this.nebula2.y += 0.3; this.nebula2.x -= 0.1; } });//end of var //ADD GAME TO SCENES Space_Game.scenes.push(lvl1State); but nothing on the page shows up. I managed to get rid of all the errors at first but then still nothing happened. Im at a loss as to how i use separate classes. i have 10 lvls so far and the player with the bullets is repeated over and over. id rather remove and learn how to separate than to just continue on how i have been with rewriting or copy paste all the repeated code then add new code for the level.