Jump to content

noobshit

Members
  • Content Count

    14
  • Joined

  • Last visited

About noobshit

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. var currentAngle = fightSprites.enemy[i].body.rotation; correctAngle = tempAngle + (3.141/2); difference = correctAngle - currentAngle; lag = 0.3; fightSprites.enemy[i].body.rotation += difference * lag; Maybe it will help.
  2. It has to be mistake in examples. Code will work, because: game.load.image(key, url, overwrite) game.load.image('menu', 'assets/buttons/number-buttons-90x90.png', 270, 180); key = 'menu'; // correct url = 'assets/buttons/number-buttons-90x90.png'; // correct overwrite = 270; // 270 in logical expression is true, no problem... // 180 will be ignored Javascript... thats the reason I'm using Typescript:
  3. /** * Internal P2 update loop. * * @method Phaser.Physics.P2#update */ update: function () { // Do nothing if the physics engine was paused before if (this.paused) { return; } if (this.useElapsedTime) { this.world.step(this.game.time.physicsElapsed); } else { this.world.step(this.frameRate); } }, /** * @property {number} frameRate - The frame rate the world will be stepped at. Defaults to 1 / 60, but you can change here. Also see useElapsedTime
  4. I'm just learning P2. Yesterday I had similar problem. Green = weapon slots and I was wondering how to spawn bullets from them. getBulletStartingPosition() : Phaser.Point { let x = this.x; let y = this.y; let angle = this.parent.angle; let d = Math.sqrt(x*x + y*y); let angleFromCenter = Utils.degrees(Math.asin(x/d)); let offset = Utils.rotateDistance(angle + angleFromCenter, d ); return new Phaser.Point(this.parent.x + offset.x, this.parent.y + offset.y); }
  5. create() { game.physics.startSystem(Phaser.Physics.P2JS); game.physics.p2.useElapsedTime = true; game.physics.p2.setImpactEvents(true); ... } // On shotgun shell shot game.time.events.add(Phaser.Timer.QUARTER * 3, this.split, this); I expected to get split at constant distance from space but it's depends on framerate. How to make time event in P2 timer? https://noobshit.github.io/ - here is example of problem (cursors to move, space to shoot)
  6. I'm making single n-back game https://noobshit.github.io/ What is best way to show user how to play? What hotkeys are used? Should I make screenshoots with additional labels/arrows to explain GUI or is there a better way?
  7. Thanks for help. I'm sure it was a problem. I have huge monitor (30'' = 2560x1600) and on fullscreen shapes moved few cm each frame, it wasn't smooth at all. In fact I was 100% sure I had performance issues. I looked at https://jsfiddle.net/BinaryMoon/a68Qp/ and I'm using now Phaser.Easing.Quadratic.InOut. Now I have to improve few more things and my first game will be done. Thank a lot!
  8. Nice update it fixed my problems which I posted in: Love ya!
  9. https://noobshit.github.io/ I'm trying to make good old n-back game. Plaese use left/right cursors to rewind tape. Even after short playing session I feel sick. Are you feel the same? What is the reason, how to avoid it?
  10. Hey! Could you help me with blinking/flicker issues? Second post has demo code and video. When I try to wrap world coins do flick/blink and user can see them for a split second in old (wrong) location. Do you have tips how to avoid it? 

     

    https://github.com/noobshit/Demo

  11. var game = new Phaser.Game(512, 512, Phaser.AUTO); var Demo = (function () { function Demo() { } Demo.prototype.preload = function () { game.load.image('player', 'assets/player.png'); game.load.spritesheet('coin', 'assets/coin.png', 44, 40); game.load.image('sky', 'assets/sky.png'); }; Demo.prototype.create = function () { game.world.setBounds(0, 0, 1024, 512); this.sky = game.add.sprite(0, 0, 'sky'); this.player = game.add.sprite(256, 256, 'player'); this.items = game.add.group(); for (var i = 0; i < 50; i+
  12. 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 )
  13. I figured out that changing group x, y does affect body.x, y with lag. Is there a way to force body to update?
  14. Hey guys! I wanted to create "can you place building here?". Sometimes I get wrong answer. I create net 10x10 createNet(width, height) { this.net.removeChildren(); for(let i = 0; i < height; i++) { for( let j = 0; j < width; j++) { this.net.create(j*16, i*16, 'net'); } } this.net.forEach( o => o.anchor.set(0.5, 0.5)); this.net.setAll('alpha', '0.5'); } I have callback: game.input.addMoveCallback( (o) => this.updateGrid()); wher
×
×
  • Create New...