Omnimaga

Calculator Community => TI Calculators => Lua => Topic started by: njaddison on November 12, 2011, 07:57:54 pm

Title: I need a lua partner!
Post by: njaddison on November 12, 2011, 07:57:54 pm
Hi, everyone. As the title says, yes, I have hit a brick wall in my production of Galaga for the nspire. javascript:void(0); I need someone who is willing to help me on many projects, who will have time to work on projects frequently, and who will be mildly tolerant of 12 year olds. javascript:void(0);
Someone please help me!!!!!!! javascript:void(0);
-Nelson
Title: Re: I need a lua partner!
Post by: Scipi on November 12, 2011, 08:30:07 pm
javascript:void(0);?

Well, I'd help however I find myself with very little time. However we'd all be happy to help with any questions and problems you might encounter. :D

What part of your code are you having problems with? Can you post some source code?
Title: Re: I need a lua partner!
Post by: epic7 on November 12, 2011, 08:42:06 pm
I'd help if I knew Lua D:
I used to know lua, but not for calc
I'm going to get CX probably but not untill after christmas
Title: Re: I need a lua partner!
Post by: njaddison on November 12, 2011, 08:44:43 pm
Here's the lua source code. I got the image drawn now, but when i try to move the spacefighter, it says line 24 "comparing a number with a nil value."
Code: [Select]
function on.paint(gc)
gc:setFont("serif", "b", 14)
gc:setColorRGB(0, 200, 0)
gc:drawString("Galaga", 100, 100)
gc:setFont("serif", "r", 12)
gc:setColorRGB(0, 0, 0)
gc:drawString("Nspire Namco Remake by Nelson Addison", 20, 120)
gc:setFont("serif", "b", 12)
gc:drawString("Press enter to Start", 90, 140)
timer.start(1)
end
function on.enterKey()
function on.paint(gc)
spacefighter = image.new("<\000\000\0002\000\000\000\000\000\000\000x\000\000\000\016\000\001\000\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128 \128 \128A\128 \128B\132\000\128\000\128\000\128\001\132\001\128\001\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128!\128\000\128!\128\000\128\001\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128!\128\000\128\000\128\000\128!\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128!\132\000\128\000\128\000\128\001\132\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\132!\132\000\128\000\128\000\128!\132\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\132\000\132\000\132\000\132\000\132B\136\255\255\255\255\255\255\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\132\000\132\001\136\000\128\000\128\000\128\222\251\255\255\255\255\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\132\000\132\000\128\000\128!\132\255\255\222\251\255\255\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128 \128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\255\255\255\255\255\251 \128\000\128\000\128\000\128!\128\000\128 \128\000\128 \128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128!\132\000\128A\132\221\247\255\251\222\243!\128\000\128!\128\000\128\000\128 \128!\128\000\128 \128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128 \128\000\128\000\128\000\128A\132\222\251\255\255\255\255\255\251\255\251\255\251\222\247\255\255\189\243\132\140 \128 \128\000\128 \128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\132\000\136\000\132\000\128\000\128\000\128\000\128\000\128\000\128\255\251\255\251\255\251\255\251\255\251\255\251\255\251\255\251\255\251\000\128 \128\000\128\000\128\000\128\000\128\000\128\000\132\000\132\000\132\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\144\000\144\000\140\000\136\000\132\000\128\000\128\000\128\000\128\255\251\255\255\255\255\255\255\255\255\255\255\255\255\255\255\254\251\000\128\000\128\000\128\000\132\000\132\000\136\000\136\000\136\000\136\000\132\000\132\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\144\000\144\000\144\000\140\000\136\000\132\000\128\000\128\000\128\255\255\255\255\255\251\255\255\222\251\222\251\255\255\222\251\255\255\000\128 \128\000\128\000\128\000\136\000\136\000\140\000\140\000\140\000\140\000\136\000\132\000\132\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\152\000\152\000\148\000\140\000\136\000\132\000\128\000\128\000\128\255\251\255\255\255\255\255\255\223\255\223\255\255\255\255\255\255\255\000\128\000\128\000\132\000\136\000\136\000\140\000\144\000\148\000\144\000\140\000\136\000\132\000\132\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\132\199\188\232\188\165\172!\152\000\136\000\136\000\132\000\128\000\128\255\255\255\255\255\255\223\255\255\255\223\255\255\255\255\255\254\255\000\128\000\128\000\132\000\132\000\140\000\144\232\180\232\180\166\168!\148\000\136\000\136\000\136\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\140\000\128\000\128\001\128\000\128\000\132\000\132\000\132\000\132\000\128!\128!\128 \128\000\128\000\136\000\144\034\228c\216\197\200\000\148\000\128\001\128\034\128\000\128\000\128\254\255\221\255\189\255\223\255\223\255\190\255\255\255\254\255\253\251 \128 \128!\128\034\128\001\128\000\156\130\220`\228\193\212\000\160\000\148\001\144\002\140\000\128\000\128\000\128\000\128\001\128\000\128\000\128\001\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128 \128\000\128\000\132\000\136\000\136\000\132\000\128\000\128 \128A\128!\128\000\128\000\140\000\152#\244C\228\131\204\000\160\000\140\000\136 \128 \128 \128\254\255\223\255\223\255\191\243\255\247\255\255\255\255\222\255\222\255!\136\000\128A\128!\128\000\128\000\164\034\220!\232b\216\000\168\000\144\000\132\001\128\001\128\000\128\000\132\000\128\000\132\000\132\001\132\000\128\000\128\000\128\000\128\000\128\000\128 \128 \128\000\128\000\128\000\128\000\136\000\132\000\128 \132\000\128\000\128\000\128\000\128\000\132\000\140\000\152\034\240B\228c\208\000\172\000\152\000\136\000\128@\128@\128\223\251\223\255\223\255\255\247\255\239\255\247\255\255\223\255\255\255\000\132\000\132\000\128A\128\000\136\000\168\134\236E\240D\216\000\160\000\132!\128\001\128\001\128\000\132\000\136\000\132\000\132\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128!\132\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\136\000\152\000\156\000\148\000\140\000\140\000\144\163\216\164\212\165\200\000\156\000\140\000\128b\136\000\128C\132\255\251\255\255\189\255\190\255\157\255\188\255\187\255\191\251\190\251!\136!\136!\132\001\128\001\136\001\160C\200d\212\230\208\000\148\000\128\000\132\000\144\000\160\001\148\000\140\000\136\000\132\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\001\132\000\132\000\132\000\128 \128 \128 \128 \128\000\128\000\152D\192f\204\133\192\000\148\000\136\000\136\187\255\155\255\188\255!\140!\128!\128|\239\191\255\159\251\255\251\253\247\154\255\007\217B\200\231\204\186\255\223\255\254\255\252\247\220\243\255\255$\132\002\132\001\140|\255\155\255\187\255@\132 \128\000\140\165\204a\220\133\176\000\152\000\144\000\136\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\001\132\000\136\000\136\000\128!\128A\128 \128 \128\000\132\000\164f\216g\232\135\212\000\160\000\136\000\132\255\251\255\251\255\255\003\128$\128$\128\223\255\191\255\223\255\222\255\252\255W\255A\212\132\232\130\2086\255\190\255\220\255\252\247\253\243\255\251\003\128\004\128\004\128\191\247\223\251\254\247@\128@\128\000\144\164\216 \236\199\192\000\156\000\148\000\136\000\128 \128\000\128\000\128\000\128\000\128\000\132\000\132\000\132\002\148\002\152\001\140\001\132!\132\000\128\000\128\000\136\000\164%\220\005\232E\216\000\164\000\144\000\136\255\251\255\247\255\247\007\128\010\136\007\132\223\255\254\255\220\255\187\255Y\255\213\254\165\232!\228b\220\021\255\026\255:\255\253\255\255\247\191\243\008\132\010\132\008\128\255\247\255\251\255\247C\128!\128\000\148\132\216\034\240\199\196\000\160\000\148\000\136\000\128 \128\000\128!\128\000\128\000\128\000\132\000\132\003\148\135\172\168\176#\148\000\128\001\132\001\132\000\128\000\140\000\168%\224&\240f\224\000\164\000\140\000\136\253\255\254\255\223\255-\140\019\144\016\140\191\255\253\255\218\255\229\188c\200\132\228\001\232\002\236c\240A\228$\216\200\200\190\255\255\251\255\251/\144\019\1440\140\255\251\252\255\254\251$\128\001\128\000\156B\212\002\240\199\196\000\160\000\148\000\136\000\128 \128\000\128\000\128\000\128\000\132\000\132\000\132\003\152\136\176\201\180#\148\001\128\034\128\000\128\000\132\000\140\000\168E\220%\232\134\216\001\156\000\136\001\132\253\247\253\251\191\251/\1366\1363\136\191\251\189\255\153\255\163\196B\224!\244\002\252\003\244\003\244\034\252\002\236\168\216\157\255\254\251\191\247\016\140\024\148\017\136\223\247\250\251\253\255\003\132\002\136\000\160\131\220$\244\165\188\000\160\000\148\000\132\000\128 \128A\128\000\128\000\128\000\132\000\132\000\132\002\144\002\148\003\152\001\132\034\128\034\132\001\132\000\128\000\132\000\156\134\204\134\216\166\196\000\144 \132\001\132\223\235\223\247\159\251O\140S\136.\132\223\255\188\255x\255\198\220\000\232\000\248B\240\002\224e\240\002\240\000\252\034\216{\255\255\251\223\247M\148\016\140P\140\223\243\191\239\255\251\005\128\002\136\000\156\164\208\034\212J\205\000\152\000\144\000\132 \128 \128 \128\000\128\000\128\000\128\000\132\000\132\001\128\000\132\001\140\002\136\001\128\001\128\001\136\001\136 \128\000\136\155\255z\255\188\255A\140\000\128\001\136U\1280\132,\136\159\247\127\243\223\251\254\255\250\255W\255c\212\001\228B\232\022\255Y\2559\255D\216 \252\130\220\186\255\188\235\255\243\223\247\223\251\223\247P\128S\128\015\128\008\132\003\132\000\136Z\255\155\2559\255 \152\000\136\000\128 \128 \128 \128\000\128\000\128\000\128\000\128\000\132A\128\000\128\001\128\001\132\001\128\001\132\001\136\000\132 \128 \128\253\251\220\251\253\251\000\128\001\132#\144U\1361\136\011\136\191\255\222\255\253\255\250\247\250\255v\255\229\208\199\224\165\196\187\255\251\239\187\251\200\188@\212\006\209\155\255\255\247\255\243\252\247\251\251\255\251.\128\185\1481\136\007\128\034\128 \128\255\251\254\255\222\255\000\140\000\136\000\128\000\128\000\128\000\128!\132\000\128\000\128\000\128\000\128\000\128\000\128\001\128\001\128\001\128\001\128\001\132\000\128 \128@\128\253\243\254\247\254\247 \128\000\128\000\128\223\247\223\255\223\255\223\255\254\251\187\239\253\247\253\255\218\255\153\255\155\255\190\255\254\251\255\247\255\251\223\255\220\255\155\255\255\255\255\251\255\247\221\247\254\251\255\251\255\247\191\239\223\247$\128 \128@\128\252\247\188\247\189\255\000\128\000\132\000\128\000\128\034\132\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\001\128\001\128!\128 \128\000\128 \128\000\128\221\247\255\251\255\255\000\128!\128!\128\249\243\252\255\190\251\255\251\255\247\255\247\191\247\222\255\220\255\187\247\253\247\255\255\255\255\255\255\189\247\255\255\254\235\255\247\223\255\158\255\223\255\223\255\191\255\191\251\252\251\250\247\253\255\000\128 \128@\128\252\255\221\255\254\255!\132!\132\000\128\000\128\001\132\000\128\001\132\000\128\000\128\000\128\000\128\000\132\000\132\000\132\001\132\001\128\001\128\000\128\000\128 \132\000\128\254\255\255\255\157\247\000\128\000\128!\128\251\251\252\255\253\255\189\247\255\247\255\255|\255\156\255\156\255\222\255\255\255\222\255\255\255\223\255\222\255\255\255\254\239\223\255<\255\092\255\157\255}\255\191\255\255\255\250\251\249\251\185\247\000\136\001\132!\128\254\255\189\251\255\247 \128\000\128\000\128\000\128\000\132\001\132\001\132\000\128\000\128\000\128\000\128\000\128\000\128\000\132\002\136\001\132\001\128\000\128\000\128\000\128B\136\255\255\255\255\255\255\255\255\223\255\255\251\223\255\255\255\221\255\222\255\222\255\155\255\005\193\197\188\008\189}\255\158\255\222\255\254\251\255\251\255\255\255\255\222\255|\255\200\208\167\196\231\184\186\255\185\255\218\255\253\255\255\255\191\255\191\255\223\255\255\243\255\239\255\247\255\247A\128 \128\001\128\034\136\000\132\000\132\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128!\132\222\251\255\255\255\255\255\255\255\255\255\255\223\255\190\255\252\255\184\255v\255\243\254\163\220\132\220\166\208[\255}\255\191\255\158\251\223\255\255\255\222\255\252\247\154\255D\216e\240C\224\245\254\022\255y\255\220\255\254\255\254\255\190\255\223\255\223\255\223\255\223\255\255\255\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\255\255\255\255\255\255\255\255\222\251\255\255\223\255\189\255\187\255\228\180\195\204\196\228!\224B\220\132\208Z\255\156\255\222\251\255\251\255\255\254\255\254\255\252\243z\255e\228\003\236\034\228c\220\131\212\131\192\219\255\254\251\254\247\223\255\223\255\222\251\222\247\255\255\255\255\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128!\132\000\128\255\255\255\255\189\247\255\255\255\255\255\255\223\251\255\255{\255\131\196b\220!\236C\252\001\228c\208Z\255\188\255\255\251\255\251\255\247\254\247\255\251\253\239z\255\003\224\003\248\002\244#\240\034\232\165\220\155\255\253\247\255\251\255\255\255\251\255\251\254\247\220\247\255\255\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\255\255\255\255\255\255\255\255\255\255\222\251\255\255\190\255\025\255\199\228\002\240\002\252\001\252D\248\132\2169\255\188\255\255\251\255\247\255\251\255\255\254\251\253\243Z\255g\240\004\252\002\248\004\252\003\252D\228{\255\254\255\221\243\255\255\255\255\187\235\254\251\253\255\255\255\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\255\255\255\255\255\255\255\255\255\255\255\255\000\128\000\144\001\172\003\212E\248\004\252\002\244#\232\132\212\000\164\000\136 \128\255\255\255\255\189\247!\132\000\128\001\168F\224\004\240\004\248\003\252\004\248$\220\000\156\000\128!\128\223\255\255\255\255\251\220\247\254\255\255\255\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\255\255\255\255\255\255\156\243\222\251\255\255\001\128\000\136\000\160d\196\135\224e\228d\224\166\216c\184\000\148\000\132 \128\254\247\255\255\255\255\000\128\000\128\000\148\134\204f\220D\220f\228D\220\166\204\000\144\000\128A\132\190\251\255\255\255\255\254\251\254\255\255\255\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\255\255\222\251\222\251\132\144\000\128\000\128\000\128\000\128\000\136\000\148\000\156\000\164\000\160\000\152!\152\000\132 \132!\128\222\247\255\251\255\255\000\128A\136\000\132\000\152\000\164\000\160\000\168\000\156 \152\000\132 \128!\128\000\128\000\128\000\128\221\247\254\243\255\255\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\255\255\255\255\255\255\000\128\000\128!\132\000\128 \128\000\128 \132\000\132\000\132 \136\000\132\000\132\000\128!\132\001\128\255\251\255\255\255\255\000\128\000\128\000\132\000\136\000\136\000\140\000\132\000\132\000\128 \128 \128\000\128\000\132\000\132\000\132\255\251\255\247\255\255\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128B\136\222\251\189\247\255\255\000\128!\132\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\034\136\000\132\000\128\034\136\255\255\255\255\223\255\001\132\000\128\000\128\000\128\000\128\000\128 \128\000\128\000\128 \128 \132\000\136\001\144\000\140\001\136\189\247\255\255\222\251B\136\000\128\000\128\000\128!\132\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128!\132\000\128\000\128\000\128\000\128\000\128\000\128!\132\000\128\000\128\000\128\000\128 \128\000\128\000\128\000\128\000\132\034\140\000\132\000\132\001\132\001\128C\136\001\132\000\128\000\128\000\128\000\128 \128\000\128\000\132\000\128\000\128\000\132\001\144\001\148\001\140\000\128\165\144\000\128B\136\000\128\000\128\000\128\000\128!\132\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128B\136\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128!\136\000\128B\136\000\128\000\128\000\128\001\128\000\128\000\128\000\128 \128 \128\000\128\000\132\000\128!\132\000\128\001\140\000\140\000\128@\128 \128\000\128\000\128!\132!\132\000\128\000\128\000\128\000\128!\132\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128!\132\000\128\000\128\000\128\000\128\000\128!\128\000\128\000\128\000\128\000\128\000\128\000\128\000\132\000\132\000\128\000\128\000\128\000\128!\128!\128!\128 \128\000\128\000\128\000\128\000\128\000\132\000\132\000\132\000\128\000\132\000\136\000\132\000\128@\128\000\128\130\136\000\128B\136\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128!\132\000\128!\132\000\128\000\128\000\128\000\128\000\128\000\132\000\132\000\136\000\132\000\132 \132\000\128B\140\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\136\000\136\000\136\000\132\000\132\000\132\000\132\000\132\000\128 \132\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128!\132\000\128\000\128\000\132\000\132\000\132\000\132\000\136\000\136\000\136\000\132\000\132\000\132\000\132\000\132\001\136\000\132\000\136\000\132\000\136\000\132\000\128\000\132\000\140\000\140\000\136\000\132\000\132!\136\000\128\000\128\000\128\000\136\000\132\000\136B\136!\132\000\128\000\128\000\128\000\128B\136\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128B\136\000\128!\132\000\128\000\128\000\128\000\132\000\132\000\128\000\128\000\128\000\132\000\132\000\132!\132\001\128\000\128\001\128\000\128\000\132\000\132!\140\000\136\000\132\000\128\000\128\001\136\001\136\001\132\000\128\000\128 \128\000\128A\132\000\128\000\132\001\136\001\136\000\128\000\128\000\128\000\128\000\128B\136\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128!\132\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\001\128\001\128\001\128\001\128!\128!\128\000\128\000\128\000\128 \132\000\132\000\132\000\128\000\128\000\128\001\128\001\128\001\128!\128 \128@\128 \128 \128 \128\001\128\001\132\002\132\000\128\000\128\000\128\000\128\000\128\000\128\000\128B\136\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128", 100, 120)
if spacefighter then
gc:drawImage(spacefighter, 0, 140)
function on.arrowLeft() if spacefighter[x]>(20)
then spacefighter[x] = spacefighter[x]-1
      end
      platform.window:invalidate()
end
function on.arrowRight()
if spacefighter[x]<(120)
then spacefighter[x]=spacefighter[x]+1
        end
platform.window:invalidate()
end
end
end
end
Title: Re: I need a lua partner!
Post by: Levak on November 12, 2011, 10:07:16 pm
What are you trying to do with spacefighter[ x] ?
Since spacefighter is a TI-Image, it's a bit normal that you can't index it with x.
Title: Re: I need a lua partner!
Post by: Scipi on November 12, 2011, 10:20:38 pm
I'd use a variable to keep track of where the fighter is on the screen, one for x, and one for y. Then when you draw you draw at gc:drawImage(spacefighter,x,y)

The arrow keys would increment and decrement the variables.
Title: Re: I need a lua partner!
Post by: Levak on November 12, 2011, 10:27:29 pm
And also : Redefinding on.paint in on.enterkey is _really_ dirty unless good reason. Try to use a boolean instead.

like :

function on.paint(gc)
if showImage then
...
else
 ...
end
end
...
function on.enterkey() showImage = true end
Title: Re: I need a lua partner!
Post by: Nick on November 13, 2011, 03:30:48 am
i'd love to help you, i'm not 12 anymore, but what does it matter?
first of all, take that image.new out of your on.paint function, you only have to declare it once (out of the functions) and then just recall it when needed.
I cleaned up the code, it might be not totally perfect, as i only program lua for 6 weeks :)

Code: [Select]
function on.create()
timer.start(1)
game = false
drawfighter = false
fighter = {90,140}
end

function on.paint(gc)
if not game then
gc:setFont("serif", "b", 14)
gc:setColorRGB(0, 200, 0)
gc:drawString("Galaga", 100, 100)
gc:setFont("serif", "r", 12)
gc:setColorRGB(0, 0, 0)
gc:drawString("Nspire Namco Remake by Nelson Addison", 20, 120)
gc:setFont("serif", "b", 12)
gc:drawString("Press enter to Start", 90, 140)
else
gc:setColorRGB(0,0,0)
gc:fillRect(0,0,318,215)
end
if drawfighter then
gc:drawImage(spacefighter,fighter[1],fighter[2])
end
end

function on.enterKey()
if not game then
drawfighter = true
game = true
end
platform.window:invalidate()
end

function on.arrowLeft()
if fighter[1]>20 then
fighter[1] = fighter[1]-4
end
platform.window:invalidate()
end

function on.arrowRight()
if fighter[1]<120 then
fighter[1] = fighter[1]+4
end
platform.window:invalidate()
end

function on.timer()
platform.window:invalidate()
end


spacefighter = image.new("'\000\000\000$\000\000\000\000\000\000\000N\000\000\000\016\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\252\000\252\000\252\000\000\000\000\000\000\000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\252\000\252\000\252\000\000\000\000\000\000\000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\252\000\252\000\252\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\252\000\252\000\252\000\000\000\000\000\000\000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\252\000\252\000\252\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\252\000\252\000\252\000\000\000\000\000\000\000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\252\000\252\000\252\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\252\000\252\000\252\000\000\000\000\000\000\000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\252\000\252\000\252\000\000\000\000\000\000\000\000\000\000\000\000\000\252\000\252\000\252\000\000\000\000\000\000\255\255\255\255\255\255\000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\000\252\000\252\000\252\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\255\255\255\255\255\255\000\000\000\000\000\000\000\252\000\252\000\252\000\252\000\252\000\252\000\000\000\000\000\000\255\255\255\255\255\255\000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\000\252\000\252\000\252\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\255\255\255\255\255\255\000\000\000\000\000\000\000\252\000\252\000\252\000\252\000\252\000\252\000\000\000\000\000\000\255\255\255\255\255\255\000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\000\252\000\252\000\252\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\255\255\255\255\255\255\000\000\000\000\000\000\000\252\000\252\000\252\000\252\000\252\000\252\000\000\000\000\000\000\255\255\255\255\255\255\031\152\031\152\031\152\255\255\255\255\255\255\000\252\000\252\000\252\000\252\000\252\000\252\000\252\000\252\000\252\255\255\255\255\255\255\031\152\031\152\031\152\255\255\255\255\255\255\000\000\000\000\000\000\000\252\000\252\000\252\000\252\000\252\000\252\000\000\000\000\000\000\255\255\255\255\255\255\031\152\031\152\031\152\255\255\255\255\255\255\000\252\000\252\000\252\000\252\000\252\000\252\000\252\000\252\000\252\255\255\255\255\255\255\031\152\031\152\031\152\255\255\255\255\255\255\000\000\000\000\000\000\000\252\000\252\000\252\000\252\000\252\000\252\000\000\000\000\000\000\255\255\255\255\255\255\031\152\031\152\031\152\255\255\255\255\255\255\000\252\000\252\000\252\000\252\000\252\000\252\000\252\000\252\000\252\255\255\255\255\255\255\031\152\031\152\031\152\255\255\255\255\255\255\000\000\000\000\000\000\000\252\000\252\000\252\255\255\255\255\255\255\000\000\000\000\000\000\031\152\031\152\031\152\255\255\255\255\255\255\255\255\255\255\255\255\000\252\000\252\000\252\255\255\255\255\255\255\000\252\000\252\000\252\255\255\255\255\255\255\255\255\255\255\255\255\031\152\031\152\031\152\000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\031\152\031\152\031\152\255\255\255\255\255\255\255\255\255\255\255\255\000\252\000\252\000\252\255\255\255\255\255\255\000\252\000\252\000\252\255\255\255\255\255\255\255\255\255\255\255\255\031\152\031\152\031\152\000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\252\000\252\000\252\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\252\000\252\000\252\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\252\000\252\000\252\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\252\000\252\000\252\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\252\000\252\000\252\000\252\000\252\000\252\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\252\000\252\000\252\000\252\000\252\000\252\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\252\000\252\000\252\000\252\000\252\000\252\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\252\000\252\000\252\000\252\000\252\000\252\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\252\000\252\000\252\000\252\000\252\000\252\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\252\000\252\000\252\000\252\000\252\000\252\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\000\252\000\252\000\252\000\252\000\252\000\252\000\000\000\000\000\000\255\255\255\255\255\255\000\000\000\000\000\000\000\252\000\252\000\252\000\252\000\252\000\252\000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\000\252\000\252\000\252\000\252\000\252\000\252\000\000\000\000\000\000\255\255\255\255\255\255\000\000\000\000\000\000\000\252\000\252\000\252\000\252\000\252\000\252\000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\255\255\255\255\255\255")

oh and i have redrawn your picture without the black border and just made the background black. If now something passes behind the fighter, it wont dissapear behind the black square that was there before.
and the purpose of that timer.start(1), is it to draw the field every second? i made it so it does that, cuase in fact, in you code it did nothing :)
fighter is a table in which the variables x and y from the spacefighter are stored.
fighter[1] refers to the first element, fighter[2] to the second