#How do i make an int public?
67 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @lost quartz! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
that variable would have to be a instance or static field rather than local
and how do i make that?
i don't really understand what's written there
i'm trying to solve this
basically i declared the int cash in void setup
and now i want to change it in void clock
how do i do that?
right, you need to declare it in the class to make it an field
Looks like processing. I'm not sure the syntax for field variables
it is processing 4.1.1
You're sort of supposed to say that. This is a Java server, not a Processing server. Processing isn't Java
our teacher said it's java
I hear it's very close. But it is not Java. In Java everything must be in a class or other type definition. In processing it looks like you define methods in the middle of nowhere
(Which technically would make them functions, not methods)
that's weird
but if it's not ordinary java, that explains why 98% of what i find on the internet won't work i guess
indeed
so, how do i get my problem solved then?
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
You're going to need someone who knows processing I'm afraid
what if you declare it outside the methods
i could try that
wait i think that's how it works
why do i always forget the important things!?
it works
but instead of adding to the cash counter every 2 seconds (30 fps, should update/increase every 60 frames) it just goes up and up at the speed of sound
does processing update variables every frame?
your clock isn't actually waiting for anything
it just counts to 60, without waiting for a frame to pass before incrementing
what even is the point of your for loop there? it's essentially an infinite loop, but it tracks a variable i meaning it breaks once it reaches 2.1B
i just wanted to make a clock to increase cash every 60 frames, and the solution i was given by another person on here was that kind of for loop
you have to wait for a frame to pass
how do i do that?
idk, that's kinda specific to processing
also, counting frames isn't a great way to maintain a clock, lower-end devices will still be able to run at fps < 30
dang guess I'll either have to find someone who knows processing or find something on Google
it's for a school project, and while the school PCs are trash overall, they are good enough for high framerates.
how do i do it then?
checking actual time
all i found on google involved librarys and other shit i don't understand
and won't understand as my time is running out
no libs 
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
now i'll try to create something passable in the day i have left
and pray that my teacher will somehow not be a dick
but without that it'd be impossible, thanks so much!
so that's what draw is for
or if you're ok with a bodge for now, increment a counter there
i have no experience with processing i literally just looked at the examples
thanks again, i didn't know those examples existed!