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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -