#Timeer
1 messages ยท Page 1 of 1 (latest)
<@&987246399047479336> please have a look, thanks.
Here is an AI assisted attempt to answer your question ๐ค. Maybe it helps! In any case, a human is on the way ๐. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.
You can achieve this by using a Timer in Java. Here's an example code snippet:
import java.util.Timer;
import java.util.TimerTask;
public class Main {
public static void main(String[] args) {
Timer timer = new Timer();
timer.scheduleAtFixedRate(new TimerTask() {
int count = 0;
@Override
public void run() {
System.out.println("Code to run every 1 millisecond");
count++;
if (count == 15000) { // 15 seconds * 1000 milliseconds
timer.cancel();
}
}
}, 0, 1); // initial delay of 0 milliseconds, repeat every 1 millisecond
}
}
In this code snippet, we create a Timer object and schedule a TimerTask to run every millisecond. Inside the TimerTask's run method, we print a message and increment a counter. When the counter reaches 15000 (15 seconds * 1000 milliseconds), we cancel the timer to stop further execution.
Remember to handle exceptions that may be thrown by the Timer class and its methods.
ty
huh what is the use case?
adding health incrementally
im remaking destiny as a 2d java game
then dont do that, makje a tick system
destiny ios based off of time
its weird
and fps
im trying to make ti as close as possible
pretty sure there is a tick system
making a game without is nonsense
its a very broken one
its tied to like 3 diff things
many reasons people with higher fps take more damage
are able t stay in air longer
well anyways this approach is very very bad
and a bunch of other weird interactions
how should i do it?
Show me an article that prove that it doesn't have a tick system
tick system
we actually dont know
its so buggy thers multiple answers
its a broken game
They must have one
it's like saying a car without an engine
try to find anything abt it
If I google destiny tickrate, I find many articles about it
destiny 2*
yes, doesn't matter
Still
even if it is broken
it must have a tick system
if you don't have a tick system
you don't have a game
as simple as that
its a year 1 java class
yes, and ?
You need to make a tick system