java - how do i add a number to an integer every second -
i'm making cookie clicker sort of game , want thing every second number let's 5 added number. every second integer variable going 5. how create sort of time measuring method measures time can add number number.
public class timetesting { // i've put method here create // timer thing void timer() { } public static void main(string[] args) { // original number int number = 1; // number want added on original number every 5 seconds int addednumber = 5; } }
if you're targeting android platform use countdowntimer, allows execute code every amount of time duration. aware android doesn't work main method j2se does.
anyway, if you're looking foward program android game, i'd highly recommend start here: android development
Comments
Post a Comment