This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Messages - Nick
Pages: 1 ... 76 77 [78] 79 80
1156
« on: November 12, 2011, 05:38:29 pm »
thanks! that's really nice i'll hope i can finish it soon, so i can put it online.. but i have some delay because of a problem i'm encountering in the displaying of the ghostblock. it all works fine, but with the L blocks it just wont work... here's the code for it --variables: fallingblock[8]=width of the falling block fallingblock[6]=y-value of the block fallingblock[7]==1 or 2 checks of it is an L or reversed L block ghostblock[6]=y-value of the ghostblock ghostblock[5]=x-value og the ghostblock fallingblock[9]=height of the falling block l and m are just for loop variables
function on.ghostBlock() highest = 21 for l=1,20 do for m=1,fallingblock[8] do if (fallingblock[6]+l)<21 then if blocks[fallingblock[6]+l][fallingblock[5]+m-1]~=0 then if (fallingblock[6]+l)<highest then highest = fallingblock[6]+l if fallingblock[fallingblock[9]][m]==0 then highest = highest+1 end if fallingblock[7]==2 or fallingblock[7]==3 then if end end end end end end end ghostblock[6] = highest-fallingblock[9] ghostblock[5] = fallingblock[5] end
it shows the left one, but it has to show the right one
1157
« on: November 12, 2011, 03:43:05 pm »
nice, it is so nice that i will ask you if i'm allowed to port it to the nspire? or were you going to do it, if so, certainly do!
--edit-- sorry, i didn't notice chockosta already told you..he might do it if he wants
1158
« on: November 12, 2011, 11:45:47 am »
damned, by implementing some new stuff, i must have changed something so it goes totally wrong, nooooooo xs i hope i find it, but i have a back-up from about 1 hour ago, so i won't lose that much, but it's so frustrating
--edit-- Problem solved, accidentally removed a boolean value change... Ghostblock works, only some small problems with the L-blocks, but it's not that bad redesign complete highscore exists now of three numbers instead of 1 highscore
1159
« on: November 11, 2011, 08:59:55 pm »
it all started 5 years ago, when i wanted to make my own website, so i learned html and css (forgot a lot of it now) then, 4 years ago, i had to buy a 84+ for school ==> basic 2 years ago i tried asm, but failed last year i learned axe (finally) 1 month ago, i started with lua, which really pleases me, as it gives much larger possibilities. now i'm also learning nspire basic for a school project
1160
« on: November 11, 2011, 08:43:27 pm »
did you already started making the real game, or is this just the beginning of the project? If you have just started, i recommend to not think about the animation of the explosion yet, first get your basic game idea ready, and then start adding new features like the animation. for the arrowkeys, use the code bellow, with fighter - as x-value and fighter[y] as y value of the spacefighter.
function on.arrowLeft() if fighter[x]>(min x-value here, eg. 0) then fighter[x] = fighter[x]-1 end platform.window:invalidate() end
function on.arrowRight() if fighter[x]<(max x-value here, eg. 300) fighter[x]=fighter[x]+1 end platform.window:invalidate() end
if you work with a platform.window:invalidate() called from a timer.start function, you don't have to put it there (if your period is small enough at least), otherwise you have to put it there to redraw the fighter on the new position. and for the filesize, avoid using TI.images in the file, it makes it slower and larger. But if you'd like to use them to draw the spacefighter, you shouldn't hesitate, cause it's quite small. i think you should first start programming everything you want, and clean it afterwards, otherwise you'll spend more time on thinking how to program something small instead of programming something good. once you know how it works, you can start cleaning it an certainly reduce the filesize
1161
« on: November 11, 2011, 08:21:37 pm »
Go ahead! You don't have to make the ghost colored, it could just be a white outline or something like that If you want me to test again I'm here
you like testing, don't you? in fact, that ghost is the frame of the block that is falling, i mean that only the shape is displayed as drawRect, and in the color of the block, i only have to change the code of the instant dropdown button to find the place to display it. until now, it shows one, but on the lowest row... --edit-- Here's the new up to date tns file, 'totally' new graphics, and some bugfixes. There's only one remark, play it on the calc, cause if you're playing it on the emlator, the placing of te numbers isn't correct..idk how, but it is true btw, does anyone know how to anti-alias the sides of a gc:fillPolygon() drawing?
1162
« on: November 11, 2011, 01:34:58 pm »
you know what, i just post the code here, so if anyone feels the force to finish it or just give some solutions, go ahead if you change something, let me know, i want to know what it's going to be in the future xp --edit-- as for the background like DJ_O talked about, i've tried to set a background, but is slows down the game too fast, it's not funny playing anymore, a color might be possible, but not a picture...
1163
« on: November 11, 2011, 11:05:34 am »
oh sorry, well i don't know grammer xs but i'll thought, why not, maybe it will helps. but i wish you good luck with it, it looks nice and fluent
1164
« on: November 11, 2011, 10:25:53 am »
The screenshot is promising, do you already want to post the game, or are you gonna wait till tomorrow?
And if you need some translation help, you may ask, although my english isn't that good xp
1165
« on: November 11, 2011, 09:48:19 am »
i don't know if i can help, but it might be better/faster not to use a pixel test to check if the block has to stop. I use a table that represents the field, and every scuare block is one element in the table, so you should have a table of 20x10 i think (20 rows, 10 cols)
you just have to check if the tablevalue is 0 or 1 and if 1, stop moving..
1166
« on: November 11, 2011, 09:06:07 am »
i've found a picture on the internet from the android tetris app, and it looks really nice. Should i try to make the graphics more like this one, or is that too riscy for tetris himself to do it? otherwise, i think i would love to, but i don't want to do something completely illegal does someone has any idea if it is allowed or not? for now i'm cleaning up the code, cause that was necessary, so if you'd like i'll post it tonight or tomorrow or something, so you can have a look at it and maybe even try to help the debugging I'm also trying to insert a ghostblock (like i like to call it) the one that shows you where it is gonna fall, but it's kinda hard xs so you'll have to wait a while btw, you can see one at the picture in the right bottom corner --edit-- got the code from 15.2 Kb to 13.1 Kb started on the re-designing
1167
« on: November 11, 2011, 07:15:35 am »
oh, thanks a lot, that might be useful for some other functions too
1168
« on: November 11, 2011, 06:46:41 am »
wow, that looks really easy thanks! now my code will finally get a little more tidy but i do not understand the unpack method, what does it do? (always wanting to learn something new xp)
1169
« on: November 11, 2011, 04:50:21 am »
I was looking for a fast way to switch between colors for my tetris project, so i tried to find a faster way of choosing a color and setting it with setColorRGB(). I don't know if it's the fastest way, but it goes nice and the colde is tidy It's only to get the most basic colors: Red, Green, Blue, turquoise, pink, orange and yellow. This is what you would have normally (or better, i had): color = math.random(1,7) if color == 1 then gc:setColorRGB(255,0,0) elseif color == 2 then gc:setColorRGB(0,255,0) elseif color == 3 then gc:setColorRGB(0,0,255) elseif color == 4 then gc:setColorRGB(255,0,255) elseif color == 5 then gc:setColorRGB(0,255,255) elseif color == 6 then gc:setColorRGB(255,255,0) elseif color == 7 then gc:setColorRGB(255,150,0) end
and this is what you get now: color=math.random(1,7) colortable={0,0,0} if color<=3 then colortable[color]=255 elseif color==4 or color==5 then colortable[3]=255 colortable[color-3]=255 elseif color==6 then colortable[1]=255 colortable[2]=255 else colortable[1]=255 colortable[2]=150 end gc:setColorRGB(colortable[1],colortable[2],colortable[3])
both results are the same (luckily xp ) does anyone know if this is more relevant than the upper one?
1170
« on: November 10, 2011, 09:24:30 pm »
i'm sorry to ask you, but how can you lose your calc? do you always carry it with you..? but it would be hard indeed, good luck, hope you find it back
Pages: 1 ... 76 77 [78] 79 80
|