isekream

Members
  • Content Count

    23
  • Joined

  • Last visited

About isekream

  • Rank
    Member

Recent Profile Visitors

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

  1. I'm trying to develop an audio rhythm based 2d html5 game and need some advice. I'm trying to develop the logic to sync the audio with the games animation. I do not need a constant animated sequence nor do I need to sync user input but I do need the animation to play once per selected be at and on time/ beat and be able to increase the number of beats eventually animating on almost all notes per bar for the duration of the audio. Now I've researched various method on how to compensate FPS for BPS when trying to sync audio with visual/ input tasks but I'm wondering if this is overkill for me. I have access to the audio's time update method and the BPM of each audio. I also have the time position of each beat( via http://sonicapi.com). In having all these factors I'm asking the following questions Should I sync the BPS with FPS to get audio sync? Should I update animations based on audio current playhead? Should I try to correlate a currentime stamp with the audio playhead position and try to use the audio beat time position for accuracy? As a side note Has anyone ever trying to fiddle with detecting "voice notes" in a song? I'm looking at PulseJS and ClubberJS but not sure how to devise a detection formula
  2. Have you tried creating collision groups?
  3. Move the location of the game. So updated the link information
  4. @WombatTurkey Sorry about the mess. I have been redrafting the game and this is the new version
  5. There should be a URL link that you can type in the browser underneath the QR CODE
  6. Hey guys, I made this game using phaser and wanted some feedback on it our pc or laptop go to Air Console from your pc or laptop and connect using your smartphone via the Code. The aim of the game is to keep the ball in the air by moving the player across the screen via the touch gestures using your connected mobile device. You have to click CONTINUE then START to BEGIN the game! Some areas I have concerns with are :- Ball gets stuck in middle of player when colliding Audio on safari seems to be inefficient the multiple audio is played. Not sure how to combat these obstacles but any feedback is appreciated thanks
  7. Hey guys, I made this game using phaser and wanted some feedback on it our pc or laptop go to https://soccerhead.herokuapp.com from your pc or laptop and connect using your smartphone. Some areas I have concerns with are :- Ball gets stuck in middle of player Audio on safari Not sure how to combat these obstacles but any feedback is appreciated thanks
  8. Ok i'm not sure why but I had to do the following in order to get it to work. pauseUpdate() { if(this.unpaused) { delete this.unpaused; this.game.paused = false; console.log('unpaused'); } } startGame() { this.unpaused = true; this.game.paused = false; console.log('start game'); } Have to call game.paused = true twice.... the log at pausedUpdate() indicates that game.paused is being set back to true. Not sure why
  9. Not sure why my formatting isn't working sorry
  10. I don't know how else to pause game. I am trying to halt the "ball" physics from running until player is ready.
  11. class GameStatePlay extends Phaser.State { init() { this.game.paused = true; this.onEndGamePlayEvent = new Phaser.Signal(); this.onStartGamePlayEvent = new Phaser.Signal(); this.onStartGamePlayEvent.add(this.startGame, this); } create() { let game = this.game; let playerCollision = game.physics.p2.createCollisionGroup(); let ballCollision = game.physics.p2.createCollisionGroup(); game.physics.p2.updateBoundsCollisionGroup(); let timeBoard = new TimeBoard(game); game.world.addChild(timeBoard); let timer = game.time.create(false); timer.lastDroppedBall = 0; timer.loop(1, timeBoard.updateTimeText, timeBoard, timer); timer.start(); // load player let player = new Player(game); game.physics.p2.enable(player); game.world.add(player); player.body.clearShapes(); player.body.mass = 200; player.body.damping = 1; player.body.kinematic = true; player.body.loadPolygon('playerPolygon','player'); player.body.setCollisionGroup(playerCollision); player.body.collides(ballCollision, player.updateScore, player); player.body.allowRotation = false; player.body.fixedRotation = true; player.body.immovable = true; player.body.onBeginContact.add(player.headerBall, player); player.statistics = game.cache.getPhysicsData('playerPolygon', 'player'); player.assignShapeNames(); player.onUpdateScoreEvent.add(timeBoard.updateScoreText, timeBoard, 0, timer); // start two way game.client.subscribe('/faye/desktop/move/' + game.uniqid , function(e){ player.move.execute(e); } ); // load ball let ball = new Ball(game); ball.checkWorldBounds = true; game.physics.p2.enable(ball); game.world.add(ball); ball.body.mass = 0.43; ball.body.damping = 0.151; ball.body.setCircle(28); ball.body.allowRotation = true; ball.body.fixedRotation = false; ball.body.adjustCenterOfMass(); ball.body.setCollisionGroup(ballCollision); ball.body.collides(playerCollision); ball.events.onOutOfBounds.add(this.hasDroppedBall, timer); ball.body.enabled = false; let st = this; game.client.subscribe('/faye/desktop/start/' + game.uniqid , function(){ st.onStartGamePlayEvent.dispatch(); }); } startGame() { this.game.paused = false; this.game.enableStep(); this.game.step(); console.log(this.game.paused); } hasDroppedBall(time){ let timer = this; if(timer.running && ((time - timer.lastDroppedBall) < 1000)) { timer.stop(true); setTimeout(function(){ timer.game.state.start('end'); },1000); } timer.lastDroppedBall = time; } } I'm was doing some more modifications to see how game.paused works; As you can see GameState is inherited State Class.. Everything happens in the create() "game.client.subscribe" is a pub/sub node messaging and when it receives a message it triggers to dispatch a phaser.signal that should "un pause" the game Yes. it has been triggered and yes logs show game.paused as being false. I note if i game.paused = true in init() and then game.paused = false in the create() the game works as expected. My only other theory is that context is not being referenced properly thus why I resorted to using Signals
  12. Sorry if it doesn't seem clear "startGame" is being called by an anonymous function created in the state as shown in the 2nd snippet. game._codePaused is apparently a private var in the Phaser.Game class when i outputted it to log. This is driving me nuts as all documentation and research is showing is that to pause and unease a game is a simple matter of setting the variable...I'm at odds end as to why it isn't "unpausing"
  13. Thanks but I am using P2 Physics. I check ended up doing a conditional check for the sprite's.x value against the floor on an update()