Show 40 post(s) from this thread on one page
Page 53 of 342 First ... 3 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 103 153 ... Last
• 04-15-2006, 07:34 AM
Altair
no prob man
• 04-15-2006, 08:13 AM
Mast3r_Shak3
Would this work?
Code:

time = Timer:new()
score = 0

while true do

if time = time + 1 then
score = score + 5
end

(i just wrote that)
• 04-15-2006, 08:19 AM
Slasher
Quote:

Originally Posted by MaSt3r_ShAk3
Would this work?
Code:

time = Timer:new()
score = 0

while true do

if time = time + 1 then
score = score + 5
end

(i just wrote that)

nope that won't work. if I knew sorta what you were trying to accomplish I can try and help.
• 04-15-2006, 08:19 AM
Altair
i dont think so because the timer is in miliseconds and the highest framerate is 60 fps so then time is never time+1 but more. you can also just use time as a variable and increment it by 1 each time it goes through the loop.
• 04-15-2006, 08:22 AM
Mast3r_Shak3
Quote:

Originally Posted by Slasher
nope that won't work. if I knew sorta what you were trying to accomplish I can try and help.

I want it that every half second the score increases by 5

@altair- how would I do that? just put score = score + 1 at the bottom of the loop?
• 04-15-2006, 08:24 AM
Altair
This would work:
Code:

when true do

if time/1000=timeold/1000 +1 then
score = score + 5
end

"more code here"

timeold=time
end

Notice: Put "timeold=time" at the end of the loop
BTW Maybe you need to make it like this:
Code:

if time/1000>=timeold/1000 +1 then
Because the loop is probably not precisely 1 second or a multiple of that. This wont affect the rest of the game because the timer will keep running so you still get 5 points per second. Hope thats clear

NVM the var-thing I didn't know you wanted to do that after each second
• 04-15-2006, 08:37 AM
Mast3r_Shak3
Ok.. would i do time = timer:new() before the loop? or store a nil value in time
• 04-15-2006, 08:51 AM
Altair
yeah time = timer:new() before the loop. Also you should start the timer at the beginning of the game. SO maybe something like this:
Code:

if start==false then
time:start()
start==true
end

• 04-15-2006, 08:54 AM
Mast3r_Shak3
I get, Error: attempt to index global 'timer' (a nil value)...
• 04-15-2006, 09:01 AM
Altair
ok i forgot i just used your code but its like this:
time=Timer.new()
• 04-15-2006, 09:02 AM
GWKYOU
i got this error whats rong?
C:\Documents and Settings\Mori\Desktop\lua \luaplayerwindows>luaplay er rock.lua
error: rock.lua:41: Argument error: The Controls functions take no arguments (an
d also, must be called with a colon from an instance: e g mycontrols:left().
• 04-15-2006, 09:05 AM
Altair
show the rest of your code and atleast line 41
• 04-15-2006, 09:08 AM
GWKYOU
its the one you helped me w/
• 04-15-2006, 09:08 AM
Mast3r_Shak3
wtf??? this is annoying "error: Calling 'new' on bad self (number expected, got table)" its reffering to the time = Timer:new()
• 04-15-2006, 09:15 AM
Mast3r_Shak3
ah, ill hold off on score til the 2nd release
• 04-15-2006, 09:22 AM
Altair
did you read my last post on that? Its on the bottom of the page before this.
I sain it should be:
time=Timer.new()
• 04-15-2006, 09:31 AM
Mast3r_Shak3
Yeah... I still got errors :dry: But I realized I do need it to increase speed every 10 seconds...
Code:

Error: Calling 'new' on bad self (number expected, got table)
its referring to the time = Timer:new()
• 04-15-2006, 09:36 AM
Altair
its time=Timer.new() NOT time = Timer:new() note the point instead of the double colon
• 04-15-2006, 09:39 AM
Mast3r_Shak3
Ah, lemme try it out...

Error: Attempt to perform arithmetic on global 'time' (a userdata value)
• 04-15-2006, 09:49 AM
GWKYOU
i cant get a pause to work... what i would like is for ex

screen:print(10, 20, "BLALALALAL" color1)
-- Have it pause for x amount of time then play the next line
• 04-15-2006, 09:51 AM
Mast3r_Shak3
You have to add a screen.waitVblankStart() and put your delay in the (). Keep in mind 60 will have a 1 second delay
• 04-15-2006, 10:00 AM
GWKYOU
that is what did but it seems to add up all the time and have ya wait in the begining
• 04-15-2006, 10:05 AM
Mast3r_Shak3
Do you want the same interval between each string?
• 04-15-2006, 10:08 AM
GWKYOU
nope could that be why?
• 04-15-2006, 10:29 AM
Mast3r_Shak3
Well, if you wanted different intervals you would be putting screen.waitVblankStart() after every string. Then putting screen.flip() at the end... post ur code
• 04-15-2006, 10:33 AM
GWKYOU
k here it is:
Quote:

----joke
white= Color.new(225,225,225)
screen.flip()
screen:print(10, 10, "Opening Flash0", white)
screen.waitVblankStart(12 0)
screen:print(10, 20, "Cant Open... Starting Brute Force", white)
screen.waitVblankStart(12 0)
screen.waitVblankStart(10 )
screen:print(10, 35, "980341809314789312489132 748913298478913", white)
screen.waitVblankStart(10 )
screen:print(10, 40, "324902023423043204023490 234023943204932", white)
screen.waitVblankStart(5)
screen:print(10, 50, "Flash0 Open.. Shuting Down will cuas a brick.", white)
screen.waitVblankStart(20 )
screen:print(10, 60, "Flash0:/vsh is being delited", white)
screen.waitVblankStart(60 )
screen:print(10, 70, "There you Go Pricked PSP", white)
screen.waitVblankStart(5)
screen:print(10, 80, "Enjoy By-By now", white)
screen.waitVblankStart(30 )
screen.flip()
• 04-15-2006, 10:43 AM
Mast3r_Shak3
Code:

----joke
white= Color.new(225,225,225)

while true do

screen:print(10, 10, "Opening Flash0", white)
screen.waitVblankStart(120)
screen.flip()

screen:print(10, 20, "Cant Open... Starting Brute Force", white)
screen.waitVblankStart(120)
screen.flip()

screen.waitVblankStart(10)
screen.flip()

screen:print(10, 35, "9803418093147893124891327 48913298478913", white)
screen.waitVblankStart(10)
screen.flip()

screen:print(10, 40, "3249020234230432040234902 34023943204932", white)
screen.waitVblankStart(5)
screen.flip()

screen:print(10, 50, "Flash0 Open.. Shuting Down will cuas a brick.", white)
screen.waitVblankStart(20)
screen.flip()

screen:print(10, 60, "Flash0:/vsh is being delited", white)
screen.waitVblankStart(60)
screen.flip()

screen:print(10, 70, "There you Go Bricked PSP", white)
screen.waitVblankStart(5)
screen.flip()

screen:print(10, 80, "Enjoy By-By now", white)
screen.waitVblankStart(30)
screen.flip()

end

try that...
• 04-15-2006, 10:53 AM
GWKYOU
no error it just does not show any thing
• 04-15-2006, 10:54 AM
Mast3r_Shak3
What?? That doesnt make sense...
• 04-15-2006, 10:55 AM
GWKYOU
there is no text on the psp it did not print to screen
Show 40 post(s) from this thread on one page
Page 53 of 342 First ... 3 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 103 153 ... Last