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 ... 24 25 [26] 27 28 ... 31
376
« on: July 11, 2011, 01:01:28 pm »
Well, the framerate is key input framerate. I don't know exacty it. between 2 and 3 fps on my calc EDIT : or maybe more, I really don't know
377
« on: July 11, 2011, 12:49:01 pm »
Sure... But it's not very good-looking :
function racine(a) x=1 y=0.5*(1+a) while math.abs(y-x)>0.001 do x=y y=0.5*(x+a/x) end return y end
function renderMap(gc,map,w,h,camera) for x=0,w,2 do dirX=math.cos(camera[3]) dirY=math.sin(camera[3]) planeX=math.cos(camera[3]-1.5707963267949) planeY=math.sin(camera[3]-1.5707963267949) cameraX=(x*2/w)-1 rayPosX=camera[1] rayPosY=camera[2] rayDirX=dirX+planeX*cameraX rayDirY=dirY+planeY*cameraX mapX=math.floor(rayPosX) mapY=math.floor(rayPosY) deltaDistX=racine(1+(rayDirY*rayDirY)/(rayDirX*rayDirX)) deltaDistY=racine(1+(rayDirX*rayDirX)/(rayDirY*rayDirY)) hit=0 if rayDirX<0 then stepX=-1 sideDistX=(rayPosX-mapX)*deltaDistX else stepX = 1; sideDistX = (mapX+1-rayPosX)*deltaDistX end if rayDirY<0 then stepY=-1; sideDistY=(rayPosY-mapY)*deltaDistY else stepY=1; sideDistY=(mapY+1-rayPosY)*deltaDistY end
while hit==0 do if sideDistX<sideDistY then sideDistX=sideDistX+deltaDistX mapX=mapX+stepX side=0 else sideDistY=sideDistY+deltaDistY mapY=mapY+stepY side=1 end
if map[mapX][mapY]>0 then hit=1 end end if side==0 then perpWallDist=math.abs((mapX-rayPosX+(1-stepX)/2)/rayDirX) else perpWallDist=math.abs((mapY-rayPosY+(1-stepY)/2)/rayDirY) end hauteurLigne=math.abs(math.floor(h/perpWallDist)) drawStart=math.floor(-hauteurLigne/2+h/2) drawEnd=math.floor(hauteurLigne/2+h/2) if drawStart<0 then drawStart=0 end if drawEnd>=h then drawEnd=h-1 end
gc:setColorRGB(10,10,10) if side==1 then gc:setColorRGB(100,100,100) end gc:fillRect(x,drawStart,2,drawEnd-drawStart) end end
function on.escapeKey() menu=1 platform.window:invalidate() end on.escapeKey()
function on.enterKey() menu=nil fovy=60 camera={10,10,0.05} w=320 h=240 planeX=0 planeY=1 map={{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},{1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,1},{1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1},{1,0,0,0,0,0,1,0,0,1,1,1,1,1,1,1},{1,0,0,1,1,1,1,0,0,1,0,0,0,0,0,1},{1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1},{1,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1},{1,0,0,0,0,0,1,0,0,1,0,0,1,0,0,1},{1,1,1,1,1,1,1,0,0,1,0,0,1,0,0,1},{1,0,0,1,0,0,0,0,0,0,0,0,1,1,1,1},{1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1},{1,0,0,1,1,1,1,1,1,1,1,1,1,0,0,1},{1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,1},{1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,1},{1,0,0,1,1,1,0,0,1,1,1,1,1,0,0,1},{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}} platform.window:invalidate() end
function on.arrowKey(ar) turn=nil if ar=="right" then camera[3]=camera[3]-0.1 end if ar=="left" then camera[3]=camera[3]+0.1 end if ar=="up" then if map[math.floor(camera[1]+math.cos(camera[3])/3)][math.floor(camera[2]+math.sin(camera[3])/3)]==0 then camera[1]=camera[1]+math.cos(camera[3])/3 camera[2]=camera[2]+math.sin(camera[3])/3 end end if ar=="down" then if map[math.floor(camera[1]-math.cos(camera[3])/4)][math.floor(camera[2]-math.sin(camera[3])/4)]==0 then camera[1]=camera[1]-math.cos(camera[3])/4 camera[2]=camera[2]-math.sin(camera[3])/4 end
end platform.window:invalidate() end
function on.paint(gc) if menu then gc:setColorRGB(0,0,255) gc:setFont("sansserif","r",30) gc:drawString("RayCaster Demo",30,0,"top") gc:setFont("serif","b",10) gc:drawString("Press Enter to start",100,100,"top") else gc:setColorRGB(200,200,200) gc:fillRect(0,0,platform.window:width(),platform.window:height()) renderMap(gc,map,platform.window:width(),platform.window:height(),camera) end gc:setColorRGB(0,0,0) gc:setFont("sansserif","r",8) gc:drawString("Lua RayCaster Demo - Par Loic Pujet",10,200,"top") end
378
« on: July 11, 2011, 12:20:52 pm »
I plan to do that. But I need some time  I'll post here when I will have something decent.
379
« on: July 11, 2011, 12:11:31 pm »
Yep.
A raycaster is a tiny 3D engine which allows only perpendicular walls.
380
« on: July 11, 2011, 12:00:35 pm »
Hello guys !
With the OS 3, we had no mean to have 3D games on our calcs. This was a shame, because it's really funny when people are amazed by on-calc 3D stuff. (Actually, there is already Make3D by Levak) But now, the first raycaster engine in Lua is released ! It's only a demo, you can move in a small 3D world in greyscale (I'll add colors). Since Lua is interpreted, it's not really fast. So it's not very good-looking, because I cast one ray for two-pixels-wide columns... Unfortunately, textures are impossible (it would become too much slow)
I plan to do a 3D game with this little engine... But nDoom will stay really really better than it. (I attach the released demo and two screenies. Enjoy !)
381
« on: July 08, 2011, 10:29:00 am »
I really don't understand. I'm on this forum since only one month, and I read only the programming part, so I really don't understand. What happened ? Anyway, it's so sad. To me, you are one of the main calculator community members. You should just take a break for a month. Then, maybe you will leave us, but I hope you will come back. But take a break. Please.
(I just hate being French, I don't find the words to say what I think)
382
« on: July 07, 2011, 03:30:27 pm »
Sure. I don't have a CX... On my clickpad, it looks like that :
383
« on: July 07, 2011, 11:25:37 am »
I was talking of the tool which produces TNS files from LUA code. I don't really know what a shell is, but I think it's something different. (The interpretor is a shell, isn't it ?)
384
« on: July 07, 2011, 10:08:11 am »
Even if it's not a compiler, it looks like one... How should we call that ? an "encryptor" ?
385
« on: July 07, 2011, 09:37:26 am »
Thanks everybody  DJ_O : Good idea ! I submitted it. (And a snake game that I did a long time ago)
386
« on: July 06, 2011, 04:53:08 am »
ticalc.org just accepted my prog. Download it
387
« on: July 05, 2011, 02:39:22 pm »
388
« on: July 05, 2011, 02:01:35 pm »
I love you. This was the only which lacked to the TI-Nspire
389
« on: July 05, 2011, 09:09:27 am »
I have to write the readme first (I hates these things)
EDIT : Could someone tell me if there is any mistake ?
|-----------------------------------------------------------------------| |ENGLISH | |-----------------------------------------------------------------------| | Keys : | |Arrows : select your level/control Bobby | |Enter : play the selected level | |Esc : quit the current level | |-----------------------------------------------------------------------| |Help Bobby, the rabbit, to eat all the carrots... But be careful, | |because there are lots of traps! Spikes, rotating ways, mazes... | |(Use Ctrl+? or Ctrl+H in the documentto see a detailed description of | |each block) | |-----------------------------------------------------------------------|
390
« on: July 05, 2011, 07:20:52 am »
I finally finished that level ! And it is great. For the second one, it's a good level too.
So all the 50 levels are done, I think that's the final release !
Pages: 1 ... 24 25 [26] 27 28 ... 31
|