Jump to content

Search the Community

Showing results for tags 'clock'.

  • 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 6 results

  1. i have issue in 3d analog clock i have export 3d watch from blender everything done just need to work on clock function my also fucntion is also done but its not working like clock please check the video and help me out and i have this code for clock function all Object piviot point is center but clock function not working perfectly please Check and help me out please scene.registerBeforeRender(function () { var date = new Date(); var hour = date.getHours() % 12; var minute = date.getMinutes() ; var second = date.getSeconds() ; hand_sec.rotation.y = (second/60.)*minute.*Math.PI/180.; hand_min.rotation.y = (minute/60.)*360.*Math.PI/180.; hand_hour.rotation.y = (hour/12.)*360.*Math.PI/180.; }); // this is code i have add but not working 0125.webm
  2. sout7

    Cliclock

    Goal Cliclock challenges your sense of time by having you click 10 times at 1 second intervals. While clicking, you get feedback on how off the target you are. Positive values mean you were too slow, negative mean you were too fast. You can change the number of times to click, as well as the interval. In the options menu, you can even set the measurement as beats per minute. How accurate are you? Links Web: https://cliclock.netlify.com/ Google Play: https://play.google.com/store/apps/details?id=com.cliclock.free Note: The game is available on Google Play, but it is an HTML5 game! It simply has a Cordova version.
  3. Hello, I just encountered the following issue. In two different games I am using two ways of updating the game time shown in the UI - a timer and a timed event. I've just discovered that changing the PC's clock by -1 hour (say it's 10:00 AM, I roll it back to 9:00 AM) causes the updating to stop. This issue is not present if I roll the clock forward (from 10:00 AM to 11:00 AM). I found a way around this by using setInterval and clearInterval, but I'd like to know if a Phaser internal fix or workaround exists, or maybe if I need to do something differently. Here is the case when using a timer: private startTimer(): void { this.gameTime = 0; this.timer = this.game.time.create(); this.timer.loop(Phaser.Timer.SECOND, () => { this.updateTime(); }, this); this.timer.start(); }; And here is the case when using a timed event in the second game: this.timeElapsed = 0; this.game.time.events.loop(Phaser.Timer.SECOND, () => { this.updateTimer(); }, this); Both calls are made in the play state's create function. This is on a Windows 10 PC.
  4. I have a clock with hands for hour, minute, and second. While it is not a problem to rotate the hands according to the correct time, I am not getting the correct time. It seems like the hands are opposite where they are supposed to be. Exactly opposite. I put together a playground demo to show what I am doing. Has anyone had experience with this? This same formula was working correctly in THREE.js. http://www.babylonjs-playground.com/#1JK5E8#8 Thanks in advance
  5. I'm working on a game where the player must complete a level within 30 seconds. If the player succeeds the timer is stopped, a message displays, the next level starts and the timer must be reset to 30 seconds. This all happens within the same Phaser.state. The time display only needs to be updated each second, not in between, so I looked at this example and use a time-object and initialise it with .loop() and then .start() it. When the time runs out or when player wins the timer is stopped with .stop(). The problem is that timer.Start() doesn't seem to work after the timer.Stop() was called. If looked at .pause() and resume() but I think(?) then it can potentially continue mid-second in the next level (time is very important in this game) not sure though.. Here's what I've got so far, I've isolated the code for the clock update in an example test program, see code below. var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create }); var clocktext; // bitmaptext var clocktimer; // Phaser.timer var clockseconds; // integer // ------------------------------------- // PHASER GAME FUNCTIONS // ------------------------------------- function preload() { game.load.bitmapFont('myfont', 'myfont.png', 'myfont.xml'); }; function create() { // add texts clocktext = game.add.bitmapText(160, 160, 'myfont', '---', 40); game.add.bitmapText(160, 160+80, 'myfont', 'Press R to reset timer', 40); game.add.bitmapText(160, 160+120, 'myfont', 'Press S to stop timer', 40); // timer object, note timer won't start running yet clocktimer = game.time.create(false); clocktimer.loop(Phaser.Timer.SECOND, updateDisplay, this); // handle keyboard keys R and S game.input.keyboard.onDownCallback = HandleKeyDown; clockseconds = 0; } function HandleKeyDown(e) { if (e.keyCode == 82) { initClock() }; // R = reset/init if (e.keyCode == 83) { stopClock() }; // S = stop/pause } function stopClock() { clocktimer.stop(); clocktext.text = "Stop at " + clockseconds + " seconds left"; console.log('stopClock - timer stopped'); } function initClock() { clockseconds = 5+1; // set countdown seconds, +1 because initial display will also decrease with 1 updateDisplay(); // initial display clocktimer.start(); } function updateDisplay() { // count down seconds clockseconds = clockseconds - 1; console.log('updateClock - seconds left: '+clockseconds); // check if time is up if (clockseconds <= 0) { // ohnoes! stopClock(); console.log('updateClock - time is up'); clocktext.text = 'time is up!'; } else { // update display var minutes = Math.floor(clockseconds / 60); var seconds = (clockseconds - minutes * 60); clocktext.text = "time " + (("0"+minutes).substr(-2) + ":" + ("0"+seconds).substr(-2)); }; } btw there's also this thread but that only explains how to start a timer, not how to stop and restart it.
  6. Hi, Sorry if this has been answered before but I couldn't seem to find an answer. I'm using a timer to give my player a set amount of time to complete some levels. Depending on certain actions I want to be able to give the player more or less time as the clock counts down but can't seem to find out how. I'm using this code to set up my timer: this.timer = this.game.time.create(false);this.timer.loop(timerSeconds * 1000, this.timeUp, this);this.timer.start();Is it possible to update this with an extra 5 seconds or 5 seconds less for example while it's counting down? Thanks.
×
×
  • Create New...