android
Prev Previous Post   Next Post Next
  #1  
Old 12-31-2010, 11:06 AM
WooDChecker's Avatar
WooDChecker WooDChecker is offline
Junior Member
 
Join Date: Dec 2010
Location: Germany
Posts: 35
Default Draw variable

Hi everybody.
Its about the same game like before. Mac attack. But now I want to draw a variable to the screen just like the score in the middle.

The edited stuff is red:
Code:
--Draw game    (All erasing of images need to be performed before the next set is drawn out. 
function drawGameScreen()
    newtime = gettime()
    if (newtime - oldtime) > 36 then
        moveTargets()    --Move the game forward
        oldtime = gettime()
        for i=1,#target do    --Go through all positions with a target and erase it's image.
            screen.fillrect(target[i].x,target[i].y+target[i].speed,40,44,black)
        end
        screen.fillrect(50,180,140,40,black)    --Draw out score in the center of the screen
        text.size(40)
        text.color(dGray)
        text.draw(0,180,score,"center",240)
        text.color(-12)
        text.draw(0,350,newtime,"center",240)
        screen.update()
        for i=1,#target do    --Go through all targets and draw them in their designated place and state
            target[i].get.img[target[i].state]:draw(target[i].x,target[i].y,40,44)
        end
        screen.update()
    end
end
I hope you can see whats wrong with the code because it looks:
http://img683.imageshack.us/i/howcanifixit.jpg/


-Wood
Reply With Quote

Advertisement [Remove Advertisement]

 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 09:17 PM.