| View previous topic :: View next topic |
| Author |
Message |
wekilledbambi03
Joined: 15 Oct 2005 Posts: 31
|
Posted: Sun Oct 23, 2005 11:57 am Post subject: timer |
|
|
| how exactly do you create a timer? i know its in the list of functions, but once again i have to plead stupidity. |
|
| Back to top |
|
 |
KawaGeo
Joined: 27 Aug 2005 Posts: 191 Location: Calif Mountains
|
Posted: Sun Oct 23, 2005 1:21 pm Post subject: |
|
|
Suggest to study the tutorial at http://forums.ps2dev.org/viewtopic.php?t=3685
You might be able to use Timer class for your work. If you need more assitance, I (or others) will be happy to help.
Have fun! _________________ Geo Massar
Retired Engineer |
|
| Back to top |
|
 |
nevyn
Joined: 31 Jul 2005 Posts: 136 Location: Sweden
|
Posted: Mon Oct 24, 2005 12:17 am Post subject: |
|
|
I just feel the need to say this: No one is stupid. You might be a complete n00b, your English might even suck big time, but you're not stupid. Know that you /can/ solve any problem on your own, given sufficient time to learn. This is one of my favorite quotes:
| Aaron Hillegass in 'Cocoa Programming for Mac OS X' wrote: | I have all sorts of people come to my class: the bright and the not so bright, the motivated and the lazy, the experienced and the novice. Regardless, the people who get the most from the class are always the ones who remain focused at the topic at hand.
The first trick to maintaining focus is to get enough sleep. I suggest ten hours of sleep each night while you are studying new ideas. Before dismissing this idea, try it. You will wake up refreshed and ready to learn. Caffeine is not a substitute for sleep.
The second trick is to stop thinking about yourself. While learning something new, many students will think, "Damn, this is hard for me. I wonder if I am stupid." Because stupidity is such an unthinkably terrible thing in our culture, the students will then spend hours constructing arguments that explain why they are intelligent yet are having difficulties. The moment you start down this path, you have lost your focus.
I used to have a boss named Rock. Rock had earned a degree in astrophysics from Cal Tech and never had a job where he used his knowledge of the heavens. Once I asked him if he regretted getting the degree. "My absurd degree in astrophysics has proved to be very valuable," he said, "Some things in this world are just hard. When I am struggling with something, I sometimes think, 'Damn, this is hard. I wonder if I am stupid,' and then I remember that I have a degree in astrophysics from Cal Tech; I must not be stupid."
Before going any further, assure yourself that you are not stupid and that some things are just hard. Armed with this silly affirmation and a well-rested mind, you are ready to conquer Cocoa. |
|
|
| Back to top |
|
 |
haust
Joined: 01 Oct 2005 Posts: 25 Location: France
|
Posted: Mon Oct 24, 2005 4:58 am Post subject: |
|
|
| nevyn, thank. |
|
| Back to top |
|
 |
wekilledbambi03
Joined: 15 Oct 2005 Posts: 31
|
Posted: Mon Oct 24, 2005 8:06 am Post subject: |
|
|
| i think there is a problem with my lua player. no matter what i try it says: attempt to index global "Timer" (a nil value). i even tried the led timer from the link KawaGeo gave me. i guess im not that stupid after all if its really a problem with lua. im using 11 by the way. anyone else have this problem? |
|
| Back to top |
|
 |
KawaGeo
Joined: 27 Aug 2005 Posts: 191 Location: Calif Mountains
|
Posted: Mon Oct 24, 2005 8:28 am Post subject: |
|
|
Strange, indeed.
The global "Timer" is supposed to be there in ver. 11.
It is time for Shine's gang to investigate the problem.
I agree NOBODY is stupid enough to be stupid. :)
Just a note: Windows version is not updated yet. _________________ Geo Massar
Retired Engineer |
|
| Back to top |
|
 |
wekilledbambi03
Joined: 15 Oct 2005 Posts: 31
|
Posted: Mon Oct 24, 2005 9:44 am Post subject: |
|
|
| was this problem in version 10? i know ive had them both. i cleared a bunch of stuff off of my memory stick. i may have pu on 10 instead of 11. ill have to check. |
|
| Back to top |
|
 |
wekilledbambi03
Joined: 15 Oct 2005 Posts: 31
|
Posted: Mon Oct 24, 2005 9:50 am Post subject: |
|
|
| i think i figured it out. i was launching the .lua file from file assistant. it must have an older version of lua. i tried the lua player eboot and it worked. thanks though. now back to figuring out how to create a timer. |
|
| Back to top |
|
 |
wekilledbambi03
Joined: 15 Oct 2005 Posts: 31
|
Posted: Mon Oct 24, 2005 10:31 am Post subject: |
|
|
could something like this be used to show the timer
| Code: | timer = Timer.new()
...
timer:start()
...
if x+75 == bx+3800 then
timer:stop() end
...
screen:print(120, 213, timer, red) |
|
|
| Back to top |
|
 |
KawaGeo
Joined: 27 Aug 2005 Posts: 191 Location: Calif Mountains
|
Posted: Mon Oct 24, 2005 1:11 pm Post subject: |
|
|
"timer" is a created object. It returns meaningless. You need to say "timer:time()" which returns a value in milliseconds.
Happy coding :) _________________ Geo Massar
Retired Engineer |
|
| Back to top |
|
 |
|