Omnimaga
Calculator Community => Other Calc-Related Projects and Ideas => TI-Nspire => Topic started by: Nick on November 14, 2011, 06:35:34 pm
-
Hye i started a new project recently and i wanna know what you think about it..
it's a balance game in which you have to balance the balance by making balls grow and then drop them on the balance
(http://img.removedfromgame.com/imgs/balance.jpg)
-
Sounds like a great idea -- not many physics games out there, anyway. How far have you gotten?
-
well, it's not that die hard physics :) just let it drop and balance it xp
i made the ball grow, but that's it
and by now i can move the balance with my arrows to check if this will work, and it works
-
ooh sounds like a new and challenging type of game! I like!
I +1ed ;D
EDIT: what does "Niet opgeslagen" mean?
-
that's dutch for "not saved".
it displays that if you paste the lua with scripting tools into the emulator and you dont save first
-
ooh that's cool :D
-
I should try to make this for Casio Calculators
-
go ahead.. i could send you the source when done so you can get the formulas for it
-
Oooooh, that would be great, thanks! In fact, there is lua for casio calcs so it should be an easy port. ;)
-
serious? didn't know that.. ok, that'll be great :)
-
Can't wait to see what this will become :)
-
I would love to learn Lua but I rarely programs on computer D:
-
me too, i don't even know if it will be fun.. but we'll see :) it's not that big, so i think it might be finished next week or so
@TBO_Yeong, try it, you can do a lot of stuff with lua, you really have to try it out, because otherwise you'll have to learn asm with ndless 3.0 to get real nice programs on the nspire, cause you don't have something like axe..
-
does LuaCS works well? because last time I tried it, it froze D:
-
normally it functions well, maybe you should post the code so we could see it :)
and for balance, is it possible to make a table value out of a string e.g.
ball1 = {0,0,0}
ballnr = 1
tostring("ball"..ballnr)[1] = 5
this doesn't work, but maybe something like that (but i don't know what) works?
-
Do you mean convert a table to a string, or opposite?
To simple display a table number value, use this:
a={1,2,3}
nr=1
text=tostring(a[nr])
Edit:
I get it.
If the table is a global table, you can do this
ball1={1,2,3}
nr=1
thetable = _G["ball" .. nr][5]
_G is the global table.
-
Instead of having to mess aroud with dynnamic variable names, I'd have put new balls in a Balls table, then assign an id to a ball, and call it by reading/writing like that :
Balls[ballID][1]
I did that kind of thing for my BreakOut game :
aBall = Ball(math.random(10,platform.window:width()-10-XLimit),platform.window:height()-26,-1-speedDiff,-1-speedDiff,#BallsTable+1)
table.insert(BallsTable,aBall)
Full source here. (https://github.com/adriweb/Nspire-BreakOut/blob/master/BreakOut.lua)
-
Yes, its better to keep a table with your balls in it, more flexible that way :)
/me smacks himself
-
thanks both, but i'll use adriweb's way, it'll be easier xp
well in fact, that's the way i did it with tetris too, but with blocks, but i seem to have forgotten that xp
-
And better :)