Loading...
Processing Forum
Recent Topics
All Forums
Move this topic
Forum :
Share your Work
Programming Questions
Core Library Questions
Contributed Library Questions
Android Processing
Processing with Other Languages
Integration and Hardware
Library and Tool Development
Events and Opportunities
General Discussion
Sub forum :
Move this topic
Cancel
General Discussion
Other
dak1b2006
keeping score with time
in
General Discussion
•
Other
•
5 months ago
Hi,
I want the score to go up 100 every 2sec (2000millis). How would this look?
1
Replies(2)
v.k.
Re: keeping score with time
5 months ago
an old example...
PFont font;
int initialTime;
int interval = 2000;
int score = 0;
void setup()
{
size(300, 300);
font = createFont("Arial", 30);
background(255);
fill(0);
initialTime = millis();
}
void draw()
{
background(255);
if (millis() - initialTime > interval)
{
score++;
initialTime = millis();
}
text(score, width/2, height/2);
text((millis()-initialTime)/1000, 10, height-20);
}
dak1b2006
Re: Re: keeping score with time
5 months ago
v.k.
Thanks for your quick response!!
Leave a comment on v.k.'s reply
Change topic type
Topic Type :
Discussions
Questions
No of days :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Change topic type
Cancel
Link this topic
Provide the permalink of a topic that is related to this topic
Permalink
Save
Close
Reply to dak1b2006's question
Top
Reply
{"z4289448":[25080000002139187],"z26155994":[25080000002140216,25080000002140227]}
Statistics
2
Replies
271
Views
0
Followers
Tags
No tags available for this topic.
Cancel
Actions
Permalink
Related Posts
UTC time down to milliseconds
Current time to Unix Timestamp / Ep...
Where to start: creating a high sco...
guitar tablature app