Function help !

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Question_dev
Posts: 88
Joined: Fri Aug 24, 2007 8:23 pm

Function help !

Post by Question_dev »

Hi ,

I need help with a function :
Can somebody change this LUA code into C++ code?
Thanks, credit goes to translator.


Code: Select all

green = Color.new(0,255,0)
blue = Color.new(0,0,255)
red = Color.new(255,0 ,0)


timer = Timer.new(0)
timer:stop()

function Blick()
timer:start()
if timer&#58;time&#40;&#41; >= 0 and timer&#58;time&#40;&#41; < 200 then
screen&#58;clear&#40;red&#41;
end
if timer&#58;time&#40;&#41; >= 200 and timer&#58;time&#40;&#41; < 400 then
screen&#58;clear&#40;green&#41;
end
if timer&#58;time&#40;&#41; >= 400 and timer&#58;time&#40;&#41; < 600 then
screen&#58;clear&#40;blue&#41;
end
if timer&#58;time&#40;&#41; >= 600 then
timer&#58;stop&#40;&#41;
timer&#58;reset&#40;0&#41;
end
end
|Coolj|
Posts: 3
Joined: Mon Aug 27, 2007 1:51 am

Post by |Coolj| »

Look at the psp-programming thread XD
Question_dev
Posts: 88
Joined: Fri Aug 24, 2007 8:23 pm

Post by Question_dev »

i have take a look, but cant find it :(
flatmush
Posts: 28
Joined: Tue Aug 07, 2007 9:15 am
Location: Here
Contact:

Post by flatmush »

He's already asked here http://www.psp-programming.com/forums/index.php?topic=2728.0

He's just being lazy and making requests which iirc is against the forum rules.
Question_dev
Posts: 88
Joined: Fri Aug 24, 2007 8:23 pm

Post by Question_dev »

ok, ok....

I will make it self, but how did i code a timer like in the lua script? in c++
Post Reply