Search the Community
Showing results for tags 'flickering'.
-
Flickering issue on zooming out and rotating the camera
Mrso92 posted a topic in Questions & Answers
Hello to all of you! I want to thank everyone for support on my previous issue, especially @JohnK. At that time I had(and still have because of trouble of applying his suggestion) one structural problem with performance that I am caring for a longer period of time. But that is out of the scope for the moment being because I had one little problem which troubles me a lot. Essentially from time to time when zooming out(on the maximum level) and panning the camera I have the horrendous flickering which is even more obvious than on demo due to fact that I also add transparent hole(I have not added it here for the sake of the code complexity). Issue can be seen here: https://playground.babylonjs.com/#LE1BSK#9 From my understanding the issue is happening because of some sort of weird collision between two textures ground and location one. But I really cannot afford to do any positioning change. Is there any other, more elegant way to resolve this problem? Probably I am missing something really trivial. Thanks to all -
Im having an issue with my game. The player sprite flickers when positioning at certain points in the game. My tile maps are made in tiled editor so no risk of misplacing a tile. The flickering is only vertical and the physical body of the sprite is set a little smaller than the actual sprite which is 32 x 32 while the physical body is 16 x 28. I've also noticed that the flickering varies with the setting of the velocity. As an example, when jumping above a certain platform the sprite flickers when the assigned negative velocity of y and y gravity are assigned certain value, but it doesn't flicker when assigned another value. On the other hand, on another part of the game the whole screen/camera flickers at certain height. Any thoughts?
-
Does anyone know why this house is flickering around the windows? http://www.babylonjs-playground.com/#28YUR5#212 You can download the ZIP file of the house here if that helps http://preview.punkoffice.com/obj/building3.zip I've looked at it in Blender and can't see double faces or incorrect facing normals.
-
Hey Guys, I'm pretty new with Babylonjs, and I'm facing a problem I cannot solve by myself. I have to show a metal plate, which is long and thin. So I'm going to create a ribbon, and it works fine, but when the length gets bigger or when I zoom out, the ribbon starts extremely flickering. You can see an example here: http://www.babylonjs-playground.com/#1CZ6XW#15 Thanks!
-
I want to create game with unlimited world. I decided to make world wrap to move player and items to new position when player reaches end of world. wrapHorizontal() { let padding = game.width/2; let player = this.intoHell.player; if ( player.x + padding > game.world.width) { this.wrapped.x += 1; this.intoHell.player.x = padding; this.intoHell.background.sky.tilePosition.x += 2*padding; this.intoHell.items.x -= game.world.width - 2*padding; } else if ( player.x - padding < 0 ) { this.wrapped.x -= 1; this.intoHell.player.x = game.world.width - padding; this.intoHell.background.sky.tilePosition.x -= 2*padding; this.intoHell.items.x += game.world.width - 2*padding; } } But it makes items/sky blink. I use this function everytime in update() and I move player using body.velocity from arcade physics system. What can be cause of this behavior? intohell.zip EDIT: https://github.com/noobshit/intohell
- 1 reply
-
- groups
- flickering
-
(and 1 more)
Tagged with:
-
Edit: it's not actually flickering, more shaking (only up and down). Hey, I'm (still) trying to make a vertical platformer game. I'm having a problem here where my screen is flickering and my animations for the player don't work anymore if I press the keys. Also the player won't jump anymore. I'm guessing it has something to do with the gravity or the velocity of the player or the game itself. Any ideas? Platformer.Game = function (game) {this._player;this._stars = null;this._ground = null;this._platforms = null;this._platform = null;this._numberOfPlatforms = 15;this._x = this.x;this._y = this.y;this._cursors = null;this._scoreText = null;this._score = 0;this._locs = [];};Platformer.Game.prototype = {create: function (){this.physics.startSystem(Phaser.Physics.ARCADE);this.add.sprite(0, 0, 'background');this._ground = this.add.sprite(game.world.centerX - 480, game.world.height - 124, 'ground');this.physics.enable(this._ground, Phaser.Physics.ARCADE);this._ground.body.immovable = true;this._player = this.add.sprite(this._x, this._y, 'player');game.physics.enable(this._player, Phaser.Physics.ARCADE);this._player.body.gravity.y = 300;this._player.body.bounce.y = 0.2;this._player.animations.add('walk', [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16], 10, true);this._fontStyle = {font: "40px Roboto", fill: "#fff", align: "center"};Platformer._scoreText = this.add.text(120, 20, "0", this._fontStyle);this._platforms = this.add.group();for (var i = 0; i < 20; i++) {this.createUniqueLocation();}this._platforms.sort();game.camera.follow(this._player);},managePause: function () {this.game.paused = true;var pausedText = this.add.text(100, 250, "Game paused. Click anywhere to continue.", this._fontStyle);this.input.onDown.add(function(){pausedText.destroy();this.game.paused = false;}, this);},update: function () {if (game.input.keyboard.isDown(Phaser.Keyboard.LEFT)){this._player.x -= 10;this._player.animations.play('walk');}if (game.input.keyboard.isDown(Phaser.Keyboard.RIGHT)){this._player.x += 10;this._player.animations.play('walk');}if (game.input.keyboard.isDown(Phaser.Keyboard.UP) && this._player.body.blocked.down) {this._player.y -= 10;this._player.animations.play('walk');}else {this._player.frame = 0;}this._platforms.sort('y', Phaser.Group.SORT_ASCENDING);game.physics.arcade.collide(this._player, this._ground);},createUniqueLocation: function () {do {var x = this.math.snapTo(game.world.randomX, 300) / 100;var y = this.math.snapTo(game.world.randomY, 75, this._player.y - 100) / 75;if (y > 35) {y = 35;}var idx = (y * 35) + x;}while (this._locs.indexOf(idx) !== - 1)this._locs.push(idx);this._platforms.create(x * 200, y *75, 'platform', this.rnd.integerInRange(0, 25));}};