Jump to content

Search the Community

Showing results for tags 'rate'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

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

  1. For the life of me, I can't find a setting which adjusts camera movements with current frame rate (automatically adjusting speed, inertia, turn rate). Camera which either warps or bogs down depending on where you look at is simply unacceptable in any application, let alone games. Maybe it's too obvious but in any case I need some help here.
  2. Hi guys, this is Gamecook, My team only cook great delicious games. We are especially good at cooking Puzzle games. Here are two new works, hope you like it, And you're appreciated if you rate them. Any ideas, let me know thanks. http://mota.9191youxi.com/H5Games/NinjaRun2/ http://mota.9191youxi.com/H5Games/SmilyCubes
  3. I am trying to fix the speed and framerate for Link if someone have any idea for doing computations, speed = function(framerate) for example Here is the code : http://codepen.io/featuresmega/pen/ALKLEj var game; var map; var layer, layer1, layer2; var player; var cursors; game = new Phaser.Game(800, 600, Phaser.CANVAS, 'Zelda Mysteries of PhaserIO', { preload: preload, create: create, update: update, render: render }); function preload() { game.load.tilemap('zelda', 'http://crossorigin.me/http://asciimulation.link/assets/tiles/zelda.json', null, Phaser.Tilemap.TILED_JSON); game.load.image('tiles', 'http://crossorigin.me/http://asciimulation.link/assets/tiles/light_world.tiles.png'); game.load.spritesheet('link', 'http://crossorigin.me/http://asciimulation.link/assets/sprites/walking.tunic.png', 24, 32, 55); } function create() { //World map = game.add.tilemap('zelda'); map.addTilesetImage('light_world.tiles', 'tiles'); currentTile = map.getTile(2, 3); layer = map.createLayer('Calque de Tile 1'); layer = map.createLayer('Calque 2'); //Player player = game.add.sprite(50, 150, 'link'); player.scale.set(2); player.smoothed = false; player.animations.add('right', [0, 1, 2, 3, 4, 5, 6, 7], 20, false); player.animations.add('up', [12, 13, 14, 15, 16, 17, 18], 8, false); player.animations.add('left', [33, 34, 35, 36, 37, 38, 39, 40], 8, false); player.animations.add('down', [44, 45, 46, 47, 48, 49, 50, 51], 8, false); game.physics.enable(player, Phaser.Physics.ARCADE); game.camera.follow(player); cursors = game.input.keyboard.createCursorKeys(); } function update() { player.body.velocity.x = 0; player.body.velocity.y = 0; var speed = 200; if (cursors.right.isDown) { game.camera.x += 4; player.body.velocity.x = +speed; player.animations.play('right'); } else if (cursors.up.isDown) { game.camera.y -= 4; player.body.velocity.y = -speed; player.animations.play('up'); } else if (cursors.left.isDown) { game.camera.x -= 4; player.body.velocity.x = -speed; player.animations.play('left'); } else if (cursors.down.isDown) { game.camera.y += 4; player.body.velocity.y = +speed; player.animations.play('down'); } else { player.animations.stop(); } } function render() { game.debug.spriteInfo(player, 20, 32); }
  4. I recently came across on a really strange behavior with game.time. What I am trying to do is to update my character position regardless of the monitor refresh rate, i.e regardless if my monitor is setup on 60hz, or 50hz, I want to move my character the same amount of pixels for the same amount of time. In a previous topic, I have been advised to update the position at a factor of the elapsed time since the last frame. // Get the time in seconds since the last framevar deltaTime = game.time.elapsed / 1000;// Move the character to the right at 500 pixels per second, regardless of frameratecharacter.x += 500 * deltaTime;Doing so surprisingly didn't fixed my problem and my character was still moving slower at 50hz than on 60hz. Digging into the issue showed that the math was correct, but the game.time is falling behind the 'real' time when running on 50hz. I have setup a simple example, which shows this behaviour. I am moving a ball from the left side of the screen to the right. Once the ball leaves the screen, I determ what time has passed both using game.time and Date(). Running this example on 60hz shows similar values, while running on 50hz shows a big difference between both times with game.time falling behind from 'real' time. test.prototype = { this.ball = null, this.phaserTime = 0, this.startTime = 0, this.timeSet = false; this.collisionDetected = false; preload: function() { this.game.load.image('img', 'ball.png'); }, create: function() { this.ball = this.game.add.sprite(0, this.game.world.centerY, 'img'); this.game.physics.arcade.enable(this.ball); this.ball.checkWorldBounds = true; this.ball.events.onOutOfBounds.add(this.worldCollide, this); }, update:function() { if(this.collisionDetected) { return; } if(!this.timeSet) { this.startTime = Date.now(); this.phaserTime = 0; this.timeSet = true; } var deltaTime = this.game.time.elapsed / 1000; this.ball.x += 300 * deltaTime; this.phaserTime += deltaTime; }, worldCollide: function() { this.collisionDetected = true; var realTime = (Date.now() - this.startTime) / 1000; var deltaTime = this.game.time.elapsed / 1000; this.phaserTime += deltaTime; console.log('Phaser time', this.phaserTime); console.log('Real Time', realTime); }}Test on 60hzupdate - 122 callsPhaser time - 2.017 secReal Time - 2.027 sec Test on 50hzupdate - 121 callsPhaser time - 2.029 secReal Time - 2.411 sec If someone can explain this behavior I would be really grateful as I really want to make my game independent from the monitor frequency.
  5. My fps get over 60 (about 1k in a few seconds). What's wrong? It happens when window isn't active or if I open and close console all the time. What's wrong? I'm so confused… Is there vsync now that I need to turn on or something?
×
×
  • Create New...