Author Topic: Bloxorz  (Read 19248 times)

0 Members and 1 Guest are viewing this topic.

Offline AzNg0d1030

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 522
  • Rating: +45/-4
  • Hardcore anime watcher.
    • View Profile
Re: Bloxorz
« Reply #30 on: November 22, 2011, 10:26:41 pm »
:O here you are Nick! This looks great! >:D hope you get a beta out. Hehe...

(Trololol...?)
You just lost the game.



Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: Bloxorz
« Reply #31 on: November 23, 2011, 12:46:59 pm »
working on it, but time is quite a mess right now...

i added a total of ten levels by now, should i already post it or not? it's a bit studpid, cuse they are quite easy xs but the levels are the real ones from the internet :)

and i found a strange error occuring, i know the reason, but the screen looks weird, like double layered xp

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Bloxorz
« Reply #32 on: November 23, 2011, 05:13:57 pm »
hmm, indeed weird but actually useful for debugging :P
Looks very nice, would you mind posting your map rendering code?
I'm not a nerd but I pretend:

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: Bloxorz
« Reply #33 on: November 23, 2011, 05:22:05 pm »
but as soon i press one key, doesn't matter which one, the background dissapears and everything returns to normal xp

well, for that code, it's quite "fake" 3D, i mean that i draw a tile (polygon) with a 3D look, and every row i place it a litte-le lower, and every collumn i place it a little higher..

Code: [Select]
tile = {0,84,6,94,21,92,15,82}
tilechange = {0,84,6,94,21,92,15,82}

function on.paint(gc)
gc:setColorRGB(170,170,170)
for i=1,10 do
for j=1,15 do
for k=1,7,2 do
tilechange[k]=tile[k]+i*7+j*16-18
tilechange[k+1]=tile[k+1]+i*11-j*2+5
end
gc:fillPolygon(tilechange)
tilechange = {0,84,6,94,21,92,15,82}
end
end
end

--edit--
this draws the full map on the screen, in the game i have another list for each level that contains 10 rows of 15 tiles to see if it has to be drawn or not
« Last Edit: November 23, 2011, 05:24:21 pm by Nick »

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Bloxorz
« Reply #34 on: November 29, 2011, 07:05:16 am »
That code looks quite nice :)
Only one thing, wouldn't tilechange better be a local variable?
From what I see I don't think its necessary to be global, and if you do lots of tweaks like this you will get speed improvement :)

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: Bloxorz
« Reply #35 on: December 01, 2011, 03:43:21 pm »
i'll change it directly, hope it got some effect, but it think that speed improvement isn't needed, as it reacts to keypresses nearly directly...

Does anyone have some ideas for a highscore? i don't really know what i should count as highscore, as when i take the lowest nr of movements, you have a highscore when finishing the first level. It has to be something that's over all the levels. Now i use totalmoves/levels played, but it's kinda strange i think.

update:
16 perfectly working levels (not those with the splitting parts), i think i'll keep it with that. Maybe i'll make a leveleditor in later updates, but we'll see..

now working on a graphical level selector and menu

Offline AzNg0d1030

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 522
  • Rating: +45/-4
  • Hardcore anime watcher.
    • View Profile
Re: Bloxorz
« Reply #36 on: December 02, 2011, 07:36:24 pm »
i'll change it directly, hope it got some effect, but it think that speed improvement isn't needed, as it reacts to keypresses nearly directly...

Does anyone have some ideas for a highscore? i don't really know what i should count as highscore, as when i take the lowest nr of movements, you have a highscore when finishing the first level. It has to be something that's over all the levels. Now i use totalmoves/levels played, but it's kinda strange i think.

update:
16 perfectly working levels (not those with the splitting parts), i think i'll keep it with that. Maybe i'll make a leveleditor in later updates, but we'll see..

now working on a graphical level selector and menu

ooohoo hoo hoo looking forward :D
You just lost the game.



Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Bloxorz
« Reply #37 on: December 25, 2011, 11:26:44 pm »
Is double layering normally possible in Lua? If not, then maybe you just unintentionally discovered how to? O.O (Although I bet this might go away in future OS updates)

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: Bloxorz
« Reply #38 on: December 26, 2011, 02:15:23 am »
what do you mean with double layered? i just draw the field first, whereafter i draw the block. That way the block is always painted last and stand at the top of the 'layering' so you can see that one here it it drawn.. was that what you ment?

or do you mean with the error screen?
« Last Edit: December 26, 2011, 02:15:46 am by Nick »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Bloxorz
« Reply #39 on: December 27, 2011, 01:10:16 am »
I mean how the text displays over the game graphics without erasing them (when the error occurs).

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: Bloxorz
« Reply #40 on: December 27, 2011, 02:34:56 am »
well, i'm afraid this is a OS feature, and not one of the lua itself. Since when an error occurs, the lua stops running and the OS takes back control, i think that somehow the lua still runs while the os has taken over.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Bloxorz
« Reply #41 on: December 27, 2011, 02:47:14 am »
Too bad. If only it was possible. It's funny how some stuff that is achievable in TI-83+ BASIC on a shitty hardware can't even be achieved in Nspire Lua on a 10x more powerful hardware, larger screen and faster language. X.x

In TI-83+ BASIC you draw your stuff, store it into a pic, then display your text, then recall the pic. :P

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Bloxorz
« Reply #42 on: December 27, 2011, 04:45:08 am »
Well, with nspire Lua you can draw text over stuff without that it will look bad. There is no white background behind the text.
But of course it would be nice to have pixel level manipulations.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Bloxorz
« Reply #43 on: December 30, 2011, 06:14:06 pm »
Oh ok I thought it did some background thing, like in PRIZM BASIC.