0 Members and 4 Guests are viewing this topic.
money=0energy=100fame=0function on.paint(gc)gc:setFont("sansserif","b",15)gc:drawString("Pennergame",0,0,"top")gc:setFont("sansserif","b",12)gc:drawString("1.Arbeiten (Bringt Geld)",0,80,"top")gc:drawString("2.Ausruhen (Bringt Energie)",0,100,"top")gc:drawString("3.Sachen kaufen (Bringt Fame)",0,120,"top")gc:setFont("sansserif","r",6)gc:drawString("Money: "..tostring(money),250,0,"top")gc:drawString("Energie: "..tostring(energy),250,10,"top")gc:drawString("Fame: "..tostring(fame),250,20,"top")gc:setFont("sansserif","b",8)gc:drawString("(C)Tim Krase",0,200,"top")endfunction on.charIn(ch)if ch=="1" thendrawArbeiten(gc)elseif ch==2 thenelseif ch==3 thenendendfunction drawArbeiten(gc)gc:setFont("sansserif","b",15)gc:drawString("1.Pflaschensammeln - 10",0,80,"top")endfunction arbeiteneingabe(ch)if ch==1 thenmoney = money + 10fame = fame - 5endend
you have to pass gc from on.paint(gc)
also dont expect too much fame and fortune, at least not for now. lol how many poeple have an nSpire in your class anyway??EDIT: also do you mean you are getting an error on line 40 too
money=0energy=100fame=0menu = truefunction on.paint(gc)if menu thengc:setFont("sansserif","b",15)gc:drawString("Pennergame",0,0,"top")gc:setFont("sansserif","b",12)gc:drawString("1.Arbeiten (Bringt Geld)",0,80,"top")gc:drawString("2.Ausruhen (Bringt Energie)",0,100,"top")gc:drawString("3.Sachen kaufen (Bringt Fame)",0,120,"top")gc:setFont("sansserif","r",6)gc:drawString("Money: "..tostring(money),250,0,"top")gc:drawString("Energie: "..tostring(energy),250,10,"top")gc:drawString("Fame: "..tostring(fame),250,20,"top")gc:setFont("sansserif","b",8)gc:drawString("(C)Tim Krase",0,200,"top")endif not menu thendrawArbeiten(gc)endendfunction on.charIn(ch)if ch=="1" thenmenu=falseelseif ch=="2" thenelseif ch=="3" thenendendfunction drawArbeiten(gc)gc:setFont("sansserif","b",15)gc:drawString("1.Flaschensammeln",0,80,"top")arbeiteneingabe(gc)endfunction arbeiteneingabe(ch)if ch=="1" thenmoney = money + 10fame = fame - 5endend
if something then --codeendif not something then --codeend
if something then --codeelse --codeend