A way of measuring time intervals for the purposes of triggering an action after some elapsed time.

learn more… | top users | synonyms

1
vote
2answers
22 views

Redeeming an item on a periodic basis

I want to allow a user to redeem a token every X time (i.e. 24 hours). Once they redeem it, they must wait X time again before redeeming the next item. This ensures that users must visit the app daily ...
1
vote
1answer
99 views

Programming game logic outside the game loop

Is there any way I can program (in Java or Python, but open to other solutions) some game logic based on events, timed and sent by player input, without dealing with it inside the game loop, by having ...
0
votes
0answers
36 views

How can I make a chronometer for an HL2: EP2 Mod?

I'm trying to make a chronometer for a mod I created. I looked on the web, but there are only countdown timers for TF2, nothing for HL2: EP2. In my case, it is an absolute necessity to use HL2: EP2. ...
0
votes
1answer
58 views

Choppy movement

So, I'm trying to write some code in C# XNA to make an enemy move in a random direction for 0.5 seconds, then switch direction and once again move for 0.5 seconds. However the problem I've discovered ...
3
votes
2answers
560 views

Creating a countdown Timer in Unity

I want to create a countdown timer in a Unity game I am creating. Up until now my game was running for a specific time but I was using InvokeRepeating to end the game after the set time. But now I ...
0
votes
1answer
70 views

What is a good clock implementation for a multiplayer game?

In cases where players need to send out their times for game state sync, can everyone send out their default timestamp implementation or should something like NTP be used? ...
1
vote
1answer
118 views

Game Maker Studio - how do I disable mouse click for a duration of time?

I Have a button that starts in a rest state, and then after clicking on the button, it animates out. I want to disable the mouse click for around 30 steps after the button has been clicked, otherwise ...
0
votes
1answer
89 views

AS3 random events using a timer

I'm making a game for an assignment at university. The game I am making requires random household appliances around a house to "turn on" at random times. The player must run around the house turning ...
0
votes
2answers
155 views

After sometime increase the speed of Instantiated object

This may look similar to "increase speed after every N seconds" type question but it's different because objects are being Instantiated and getting destroyed. In my start() method I'm calling a ...
-2
votes
1answer
65 views

How can I format the number of digits my stopwatch shows? [closed]

I have made a stopwatch that displays the time in seconds during my game in libgdx. At the moment it shows a bunch of digits after the decimal point as it runs. Does anyone know how to change it so it ...
0
votes
1answer
103 views

How to calculate a score algorithm based on elapsed time?

I'm trying to calculate an alogirthm based on elapsed time to calculate score based on a music beat. I have the music beat divided into 4 because that's the time measure of that beat. So If the user ...
1
vote
3answers
127 views

Should cooldown be time or tick based?

In the past I've done cooldowns as a specific time in ms, but I was thinking isn't having tick based cooldowns better. This would be more accurate and efficent(not sure). The bad side I can think ...
0
votes
3answers
669 views

Add a Countdown Timer that increments in JavaScript and resets per level(Resovled)

I am currently developing a Simon says type game using jquery and javascript. I have linked a fully copy of the game on github Github download and unzip to see the game fully ...
0
votes
2answers
714 views

Unity yield WaitForSeconds() not working

I am new to Unity development. I started learning Unity by reading tutorials, demos, examples, and watching videos. And I am having some trouble with using this timer. Here is my code: void ...
0
votes
2answers
115 views

How to make a wait timer?

I am making a mining styled game and am looking to make variables that effect how fast you are able to mine the block. This is the idea I have currently got but it does not wait for the timer to ...
-3
votes
1answer
190 views

Move the Object in y-axis when the timer increases [closed]

I have a model(.Fbx object),I have placed a timer.When the timer starts increasing the model/object should move down(along y axis).
3
votes
1answer
896 views

Converting time of day into a smooth day/night variable?

I'm trying to make a smooth day/night cycle for a game project that I've been working on. I've already set up a clock that adds deltaTime to seconds, wraps seconds to gameMinutes, etc. The issue that ...
1
vote
0answers
134 views

Having a hard time having consecutive animations for an attack [closed]

So I've been trying to figure this out for about 8 hours now...It's driving me nuts because I am pretty sure that it is something dead simple that I am just not understanding. I had everything working ...
0
votes
1answer
882 views

How to have an event occur after x seconds?

I want a method to run after every 10 or 15 seconds. My timer is set to: timer = (double) gameTime.ElapsedGameTime.TotalSeconds; What would be the logic to check for every 10 or 15 seconds?
1
vote
1answer
999 views

Timer.schedule(task, 0, 100) never fires

I added some code using java.util.Timer to execute my spawnMonster function every 100ms. It worked, until I tried instantiating images in it -- since it doesn't run on the libGDX core thread, there's ...
0
votes
1answer
641 views

Can't consistently add to TimeSpan for Unity Game

I'm making a game that has a timer showing how long the player has survived from being crushed by pessimism. (Long story) I'm trying to use TimeSpan in Unity to accomplish this but it seems that I'm ...
1
vote
1answer
243 views

Fire Delay Timers

I currently have a turret that can fire projectiles. I can control the delay between shots (fireDelay), and I can control the time needed to reload the magazine of the gun(reloadDelay). I do the ...
2
votes
3answers
682 views

How to display a GUI Texture for a certain amount of time

Is it possible to make a gui Texture display for a certain amount of Time.
0
votes
1answer
173 views

How to use setInterval and clearInterval

I have a game that I am making and cannot seem to get the setInterval and clearInterval methods to work. When I debug it in the browser console it shows that the method is still being called over and ...
0
votes
2answers
274 views

Creating A TickRate Class

I need to implement tickrate into my engine to handle timed events such as pushing out entity updates and I don't know where to start. I have access to a timer which allows me get the time in ...
0
votes
1answer
532 views

C++ timer function acts as if time limit is instantly reached if it is less than 1 second [closed]

I'm trying to make a Snake clone with C++ and OpenGL/GLUT, but I've been having trouble with programming the timed input. I made a timer class, as you'll see below, to be used for the short time ...
0
votes
1answer
262 views

Slick and Timers?

I'm making a game where I need events to happen in a precise amount of time. Explanation : I want that event A happens at 12000ms, and event B happens every 10000ms. So "if"s should looks like this. ...
1
vote
1answer
114 views

How do I draw text once a countdown ends?

I created a countdown in Game Maker using a variable of time. The countdown works properly and is displayed at the proper coordinates. However, when the countdown reaches zero, I want to make the ...
1
vote
1answer
212 views

How can I play an animation in response to an event?

I've written a script to play an animation, but it starts immediately as my level loads. Instead, I want it only to start when triggered by some event or after a given timeout. How can I do this?
0
votes
1answer
390 views

How to accurately count 1 second within my logic update?

I have the following method: long time = system.nanoTime(); public void count(){ if (System.nanoTime() > (time+1000000000)){ //Output something or perform action here ...
2
votes
2answers
469 views

How can I create delays for sprite animations that work correctly when the application is killed and restored?

Please see my original question here: How should I use system time to compute delay times without stutters? In summary, I am attempting to to introduce a delay (say of 5 seconds or so) before a ...
0
votes
1answer
2k views

Java High-Resolution Timer for a simple game

I want to work on a model of some kind of simple shape shooter game I would develop for either the desktop or the Android, using the libGDX library. There's something I want to incorporate into the ...
0
votes
2answers
1k views

Using System Time to compute delay times that correctly deal with app pauses?

In my Android app I have the requirement to introduce small (for slowing down animation) and larger delays (for the purpose of delaying the appearance of a character for example). I've experimented ...
7
votes
3answers
1k views

How to make something happen every N seconds in game?

I want to have something happen every N seconds, how would I do that? Maybe use a timer but how?
2
votes
1answer
141 views

Timestamps as ids in an entity manager?

I've built my own entity manager, as I found out some days ago, it is very similar to the Artemis framework. For now, I just use integers as entity ids. Behind the scenes, there is a simple integer ...
2
votes
3answers
425 views

Let a time counter working when an app is closed?

Can we let a time counter working even if an app is closed? I would like to add a timer so that we have to wait XX seconds/minutes before a building is created in a game. I don't want to use an ...
1
vote
1answer
184 views

how to calculate sky color hue in a specific way?

I have a day cicle in my game. I want to add a bluish hue to my terrain in the early morning and evening-night. I want to start transitioning from 0 hue color to the full hue color at 20 PM and reach ...
1
vote
2answers
2k views

Should I accumulate state time based on a global or a parameter?

Generally, we associate a "state time" with our sprites. Libgdx provides a method to do so: float deltaTime = Gdx.graphics.getDeltaTime(); However, in the main game loop, we have a delta time as a ...
4
votes
1answer
164 views

Time critical events based on framerate

Problem Description Basically, I've made a "programming game" in which I've made my own scripting language. It is a completely standard Lunar Lander game, though instead of directly controlling the ...
3
votes
3answers
2k views

Will running cron jobs every minute a good practice?

I'm trying to create a browser-based game (made in PHP, MySQL, Js, HTML, and CSS) that is heavily dependent on user's actions being carried out after a certain amount of time passed whether online or ...
3
votes
1answer
319 views

How to sync game tick in peer to peer game?

I am making a 2-player iphone action game using a synchronization service (in this case Firebase). The service allows state syncing through the internet, but I have to execute all game logic on the ...
1
vote
1answer
223 views

What tech will enable a script to run after a certain amount of time elapsed following a user's action?

I'm trying to experiment in creating an MMO browser-based game using PHP, MySQL, Javascript, HTML5, and CSS. There is this certain functionality that I want in my game that I'm having trouble with. ...
0
votes
1answer
133 views

Repeating Sound with Timer in Actionscript 3

I'm working on a Flash game and am trying to figure out how to repeat a sound periodically every 17 seconds. Instead, of having the sound repeat once the .mp3, .wav, finishes. The problem I'm running ...
-1
votes
2answers
343 views

Start timer in two clients the same time

I want to create a client/server turned-based game where each player will have 5 seconds in order to play. If extends this time will be other player's turn to play. In order to do this, I have created ...
8
votes
2answers
3k views

Java 2D game programming: Different approaches to make a game loop

I am new to Java game programming, but the more I read the more I'm confused, because I've seen several different approaches to make a game loop: 1. The standard approach, that uses the Timer class ...
1
vote
1answer
105 views

Can't call method out of a timer. Why? [closed]

I have another problem i can't solve by myselve. My situation: I have four FrameLayouts in LinearLayouts. I color them, set Layout hight and width at wrap content and just change the minwidth to ...
-1
votes
1answer
114 views

GameTimer too fast, Objects staying intersected and rand not returning value inbetweem min and max [closed]

So I'm developing a game called PongBreakout in c++ using a game engine i got from uni (when i was there..) I've got a few problems with my game that i'm struggling to fix and need some help to figure ...
3
votes
2answers
450 views

Lockstep Game Loop

I have an XNA game using a basic lockstep update loop. The client sends all commands to the server, and updates only if it has received the next turn's commands from the server. When does a turn end? ...
4
votes
2answers
664 views

C++/OpenGL Game - How to Make it Compatible with Screen Recorders?

I'm developing a 3D tower defense-like game in C++/OpenGL on Windows. The problem I'm having isn't about the game itself (the game runs fine), but it's about using screen recording software to record ...
0
votes
2answers
436 views

Using timer to reverse enemy movement in Flash game made with Flixel

I am creating a 2d flash game using Flixel 2.5 in Flash Builder. I am trying to reverse enemy movement on an interval so that they will move back and forth over a set space. I felt that a timer would ...