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 682 results

  1. Hi, I have a multiplayer game that works, except when two players click at the exact same time. For example 6 players are in a game. The game consists of balls being sent from one player to another. The ball is animated from sender player to receiving player. Which means when the sender sends the ball, it is no longer in his/her hands. The ball is now is the hands of the receiving player. This works perfectly except if a move is made by another sending player at the exact same time. For example, 6 players are in a game. Player1 passes Player2 the ball at the same time, Player3 passes Player4 the ball. Player1 and Player2 will work correctly, however in the case of the other two players, what happens is Player3 sends the ball to Player4 who receives it but Player3 is still holding the ball even after he/she passed the ball over to Player4. Does this issue mean I should be using a Callback? Thanks, MLA
  2. My aim is to render a 3D model on a web page and change its textures. I am using Babylon.js for the same. So far I am able to render the 3D model and change its texture but I am stuck in end beautification of the final view also known as post processing. I want to improve the quality of my rendered 3D model. I am enclosing the screenshot of what I have done(Figure 1) and what I want to achieve(Figure 2) so that you can get a clear picture of the issue.
  3. Hello there, I'm working on 2d collision and stumbled across the overlap function. I'm having trouble with something simple. I have an player entity and an npc entity with a physicsGroup set as a collision circle. As the player touches the circle, I want the npc entity to interact in some way. (say, shoots bullets at the player) I can easily listen to any collisions and trigger a boolean to true.. .. but am struggling to find a way to trigger to turn on or off depending on whether the player entity touches the collision circle. For example: Sends a log to console "collided" if player collides. If player doesnt collide, send a log to console "not colliding". Heres my entity code: export const createEntity = (scene) => { entitySprite = scene.add.sprite(487, 249, '') entityPhysicsGroup = scene.physics.add.group({}) entityPhysicsGroup.add(entitySprite) circleShape = scene.add.circle(0, 0, 0, "0xfb00", 0.3) circlePhysicsGroup = scene.physics.add.group({}) circlePhysicsGroup.add(circleShape) circleShape.body.setCircle(128, -128, -128) isTouching = false scene.physics.add.overlap(circleShape, playerSprite, (e) => { isTouching = true }) } I've tried declaring the boolean as false both globally and in the createEntity function. I've also tried this in the updateEntity function that I have. I personally would have thought that a second callback could be used to trigger a function if the player entity stops overlapping with the circle, or just something in general that listens when things are not touching. The boolean method may work but my logic used to implement it might be a little fuzzy. Any thoughts and help would be much appreciated. From a phaser 3 newbie.
  4. 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.
  5. 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. 😞
  6. 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!
  7. 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.
  8. 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
  9. 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?
  10. 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
  11. 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
  12. 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.
  13. 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
  14. 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
  15. 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
  16. Hi, guys. You that use openfl-html5 for making games, could please share with me how you integrate 3rd party javascript library (say, Leadbolt, flurry, and so on) ? Do you insert the code while writing the openfl-html5 or do you add the javascript to final code generated by openfl? And why do you take the approach you use? Thanks
  17. 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
  18. 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
  19. 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!
  20. 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
  21. 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.
  22. 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.
  23. 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.
  24. 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!
  25. 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); } }