• Content Count

  • Joined

  • Last visited

About babkamen

  • Rank

Recent Profile Visitors

526 profile views
  1. Grid Align Example When I add position param: Phaser.Actions.GridAlign(group.getChildren(), { width: 10, height: 10, cellWidth: 32, cellHeight: 32, position:Phaser.Display.Align.CENTER, x: 100, y: 100 }); Shouldn't group be centered in this example?
  2. Thank you b10b for your answer. Yes you are right, I didn't think about that as compound interest formula. Thank you for suggestion on possible solutions: 1) I totally Inderstund.And as I have seen Phaser doesn't have mechanism to set FPS. 2) In worst case if there is 30 fps(mobile devices)- 33ms, 2 frames -66ms(Maybe other number better choice for most of cases). I think this is the best possible solution. And again thank you for advice=) 3) I think I don't understand you on this case. Eg if I have formula speed+=a*dt it means for(int i=0;i<dt*1000;i++){speed+=a*0.001;} But I know that I am wrong and this doesn't make difference. For everyone that having same issue:
  3. We are making drag racing game. I need to make race time stay the same if parameters(car characteristics, road length and air density) stay the same. So what's the problem? When fps is 60 race time is always the same. But when fps is lower than 60 race time is always bigger. You can pay it here - program automatically shifts gear on red line. Relevant code from update function: now =;//convert spped from km/h to m/sspeedInMS = this.speed / 3.6;//calculate drag,rolling and net forces drag = this.dragCoef * this.frontalArea * this.airDensity * speedInMS * speedInMS / 2;rollingResistance = -this.rollingResistanceCoefficient * speedInMS;f = (this.getTorqueByRPM(rpm) * this.finalDriveRatio * this.getCurrentGearRatio()) / this.tireRadius - drag - rollingResistance;//if gear shift f=0if (this.isShiftingGear) { if (now - this.startGearShiftTime <= this.gearChangeDelay) { f = 0; } else { this.isShiftingGear = false; this.startGearShiftTime = undefined; }}//calculate accelerationvar a = f / this.mass * 2.2;//calculate speed this.speed += a * (now - this.oldTime) / 1000;//calculate rpm this.rpm = this.speed * 60 * this.finalDriveRatio * this.getCurrentGearRatio() / 2 / Math.PI / 3.6 / this.tireRadius;//calculate distancethis.distanceTraveled += this.speed * (now - this.oldTime) / 1000 / 60 / 60; Two points:- From one side program timer label gets time from game.time.totalElapsedSeconds(). Program restarts game timer when countdown finishes(game.time.reset); - From other side program increments speed based on delta time and distance based on delta time. This is two places that are affected by fps. So the question are: 1) What is the cause of problem? If I am right lower fps means less acuracy in calculations 2) What are the possible solutions to this(will apreciate links to material that describes your point)?
  4. Is it possible to do such game - in a month using MightyEditor and Phaser? Because friend says that this kind of game can be done in flash in a week. So I want to argue with him but I am new to HTML5, Phaser and MightyEditor. Thanks for help, Roman