Show Posts

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 - Chockosta

Pages: 1 ... 15 16 [17] 18 19 ... 31
241
TI-Nspire / Re: [lua] Logo interpreter
« on: November 02, 2011, 02:31:28 pm »
Wow. Good luck, it is awesome.
Not really useful, but I'd love to play with that.

242
Calculator C / Re: Timers in the Nspire
« on: November 02, 2011, 02:30:08 pm »
Oh, sorry.

Well I only use this timer as a random seed...
So I don't know how it works.

243
TI-Nspire / Re: [Lua] CubeField
« on: November 01, 2011, 02:08:51 pm »
Oh, by the way, here is the final archive...

244
TI-Nspire / Re: [Lua] CubeField
« on: November 01, 2011, 01:44:21 pm »
Hayleia :
Haven't you learnt the irregular verbs ?
(j/k :D )

Okay, I'll upload it

245
TI-Nspire / Re: [Lua] CubeField
« on: November 01, 2011, 01:26:30 pm »
Since english is my second language, my readmes look pathetic.
Here is the one that I have written for this game :
Code: (readme) [Select]
CUBEFIELD

|-------------------------------------------------------------------------------|
|FRANCAIS |
|-------------------------------------------------------------------------------|
| Touches : |
|Flèches ou 4/6 : se déplacer |
|-------------------------------------------------------------------------------|
|Ceci est un jeu inspiré de CubeRunner (pour téléphones), écrit en Lua (OS>3) |
|Survivez aussi longtemps que possible sans rentrer dans les cubes ! |
|Tous les 1000 points, un couloir annonce le passage au nivau suivant, où la |
|vitesse augmente. |
|-------------------------------------------------------------------------------|

|-------------------------------------------------------------------------------|
|ENGLISH |
|-------------------------------------------------------------------------------|
| Keys :    |
|Arrows or 4/6 : move |
|-------------------------------------------------------------------------------|
|This is a game inspired by CubeRunner (for smartphones), written in Lua (OS>3) |
|Survive as long as you can without getting hit by the cubes! |
|Every 1000 points, a corridor appears to introduce the next level, where the |
|speed icreases. |
|-------------------------------------------------------------------------------|

|-------------------------------------------------------------------------------|
|Loïc Pujet (Chockosta), 2011 |
|-------------------------------------------------------------------------------|

Is there any mistake ?

246
Calculator C / Re: Timers in the Nspire
« on: November 01, 2011, 08:35:37 am »
Well, a while ago, I started a project which was supposed to be a 84+ like clock for the nspire. (With Ndless)
But Lua came, so I gave up.

Here is the code used to display the time :
Code: [Select]
    bufDrawString(buf, 50, 0, "Nspire clock - By Loic Pujet", 0);
    uint32_t time = *(volatile uint32_t*) 0x90090000;
    sprintf(clock, "%lu : %lu : %lu", (time%86400)/3600, (time%3600)/60, time%60);
    bufDrawString(buf, 115, 150, clock, 0);

EDIT : Oops, I haven't seen that this post was quite old.
But maybe it will be useful for someone

247
TI-Nspire / Re: [Lua] CubeField
« on: November 01, 2011, 05:49:49 am »
So do you think my game is ready to be uploaded on ticalc.org and TI-planet ?

248
Humour and Jokes / Re: Peanuts!
« on: October 31, 2011, 04:50:50 pm »
There already are several Axe peanuts. Take a look at the first page...

249
Humour and Jokes / Re: Peanuts!
« on: October 31, 2011, 04:33:21 pm »
Wow ! Thanks !
Now I have two brands with my name :)


250
Humour and Jokes / Re: Peanuts!
« on: October 31, 2011, 12:49:53 pm »
This one looks great !
Great job p2 :)

251
Lua / Re: Chemical Reaction Analysis (Graphical Lua program)
« on: October 31, 2011, 08:41:38 am »
Nice work !

It is really useful...

252
TI-Nspire / Re: [Lua] Image Editor
« on: October 31, 2011, 07:21:45 am »
I don't have written any readme
* Chockosta runs

But everything should be listed in the menu

253
TI-Nspire / Re: [Lua] CubeField
« on: October 31, 2011, 07:19:06 am »
Is that just because of stupid TI's key input, or is it worse than previous versions ?

254
TI-Nspire / Re: [Lua] CubeField
« on: October 31, 2011, 07:14:07 am »
Okay, it should look better now.
Could someone try it and tell me if the 3D projection is realistic ?

DOWNLOAD

Spoiler For code:
Quote from: Lua
playerImg=image.new("\020\000\000\000\020\000\000\000\000\000\000\000(\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\128\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\128\000\128\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\128\000\128\000\128\000\128\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\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\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\128\000\128\000\128\000\128\000\128\000\000\000\000\000\128\000\128\000\128\000\128\000\128\000\128\000\000\000\000\000\000\000\000\000\000\000\128\000\128\000\128\000\128\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\128\000\128\000\128\000\128\000\000\000\000\000\000\000\128\000\128\000\128\000\128\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\128\000\128\000\128\000\128\000\000\000\128\000\128\000\128\000\128\000\128\000\000\000\000\000\000\000\000\000\128\000\128\000\000\000\000\000\000\000\000\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\000\000\000\000\000\000\000\000\000\000\128\000\128\000\128\000\128\000\000\000\000\000\000\000\000\000\000\000\128\000\128\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\128\000\128\000\128\000\128\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\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\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\128\000\128\000\128\000\128\000\128\000\000\000\000\000\128\000\128\000\128\000\128\000\128\000\128\000\000\000\000\000\000\000\000\000\000\000\128\000\128\000\128\000\128\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\128\000\128\000\128\000\128\000\000\000\000\000\000\000\128\000\128\000\128\000\128\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\128\000\128\000\128\000\128\000\000\000\128\000\128\000\128\000\128\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\128\000\128")
cubesX={1,5,7,6,4,6,4,1,3,2,3,7,8,9,1,2,3,4,2,6,7,1,9,1,2,3,4}
cubesY={1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7,8,8,8,9,9,9}
lastCube=1
player=0
speed=0.1
moving=false
dir=1
moveStart=0
menu=true
score=0
level=1
color={225,170,0}
rotation=0

function render(gc)
 drawHorizon(gc)
 local size,x,y,i,polygon
 for j=1,27 do
  i=(j+lastCube-2)%27+1
  size=100/(10-cubesY[i])
  x=(cubesX[i]-7-player)/(10-cubesY[i])*150-size/2
  y=5/(10-cubesY[i])*50-180
  polygon=rotate({x,y,x+size,y,x+size,y+size,x,y+size,x,y})
  if cubesY[i]>1 then
   gc:setColorRGB(color[1],color[2],color[3])
   gc:fillPolygon(polygon)
   gc:setColorRGB(0,0,0)
   gc:drawPolyLine(polygon)
  end
  if y+size>3 and y<17 then
   if x<6 and x+size>-6 then
    menu=true
   end
  end
 end
end

function rotate(p)
 local s,c=math.sin(rotation),math.cos(rotation)
 return {p[1]*c-p[2]*s+159,p[1]*s+p[2]*c+202,p[3]*c-p[4]*s+159,p[3]*s+p[4]*c+202,p[5]*c-p[6]*s+159,p[5]*s+p[6]*c+202,p[7]*c-p[8]*s+159,p[7]*s+p[8]*c+202,p[9]*c-p[10]*s+159,p[9]*s+p[10]*c+202}
end

function updateCubes()
 local step=menu and 0.06 or speed
 for i=1,27 do
  cubesY[i]=cubesY[i]+step
  if cubesY[i]>10 then
   if score%1000<800 then
    cubesX[i]=math.random(10,140)/10+player
   else
    cubesX[i]=math.random(10,140)/200+player+(i-1)%2*5+4.1
   end
   cubesY[i]=1
   lastCube=lastCube==1 and 27 or lastCube-1
  end
 end
end

function updateMove()
 if moving then
  player=player+0.07*dir
  if math.abs(rotation)<0.15 or dir==rotation/math.abs(rotation) then
   rotation=rotation-0.005*dir
  end
  if timer.getMilliSecCounter()-moveStart>=150 then
   moving=false
  end
 else
  if math.abs(rotation)>0.005 then
   rotation=rotation-0.005*rotation/math.abs(rotation)
  end
 end
end

function drawPlayer(gc)
 if not menu then
  gc:drawImage(playerImg,149,192)
 end
end

function drawHorizon(gc)
 local s,c=math.sin(rotation),math.cos(rotation)
 gc:setColorRGB(0,0,0)
 gc:drawLine(s*142-c*200+159,202-c*142-s*200,c*200+s*142+159,s*200-c*142+202)
end

function drawMenu(gc)
 if menu then
  gc:setColorRGB(0,0,0)
  gc:setFont("sansserif","r",30)
  gc:drawString("CubeField",80,10,"top")
  gc:setFont("sansserif","b",12)
  gc:drawString("Press Enter",115,150,"top")
  local highscore=var.recall("highscore")
  if not highscore then
   var.store("highscore",0)
   highscore=0
  end
  if score>highscore then
   var.store("highscore",score)
   document.markChanged()
  end
  local str="Score : "..tostring(score).."              Highscore : "..tostring(highscore)
  gc:drawString(str,159-gc:getStringWidth(str)/2,100,"top")
 end
end

function drawScore(gc)
 if not menu then
  gc:setColorRGB(0,0,0)
  gc:setFont("sansserif","r",12)
  gc:drawString(tostring(score),2,0,"top")
  if score%1000>950 then
   gc:setFont("sansserif","r",30)
   gc:drawString("Speed Up !",80,10,"top")
  end
 end
end

function levelUp()
 speed=speed+0.02
 level=level+1
 if (level-1)%5==0 then
  color={225,170,0}
 elseif (level-1)%5==1 then
  color={0,0,255}
 elseif (level-1)%5==2 then
  color={100,100,100}
 elseif (level-1)%5==3 then
  color={90,255,0}
 elseif (level-1)%5==4 then
  color={255,255,255}
 end
end

function on.paint(gc)
 render(gc)
 drawPlayer(gc)
 drawMenu(gc)
 drawScore(gc)
 gc:setColorRGB(0,0,0)
 gc:setFont("sansserif","r",8)
 gc:drawString("Lua CubeField - Par Loic Pujet",10,200,"top")
 timer.start(0.01)
end

function on.timer()
 timer.stop()
 updateCubes()
 updateMove()
 if not menu then
  score=score+1
  if score%1000==0 then
   levelUp()
  end
 end
 platform.window:invalidate()
end

function on.enterKey()
 if menu then
  menu=false
  speed=0.1
  moving=false
  score=0
  level=1
  color={225,170,0}
  for i=1,27 do
   cubesY[i]=cubesY[i]-5
  end
 end
end

function on.arrowLeft()
 if not menu then
  dir=-1
  moving=true
  moveStart=timer.getMilliSecCounter()
 end
end

function on.arrowRight()
 if not menu then
  dir=1
  moving=true
  moveStart=timer.getMilliSecCounter()
 end
end

function on.charIn(ch)
 if ch=="6" then
  on.arrowRight()
 elseif ch=="4" then
  on.arrowLeft()
 end
end

Generated by the BBify'r (http://clrhome.tk/resources/bbify/)

255
TI-Nspire / Re: [Lua] Image Editor
« on: October 31, 2011, 06:15:21 am »
:)

Did you draw it entirely or did you just upload it ?

Pages: 1 ... 15 16 [17] 18 19 ... 31