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 ... 28 29 [30] 31
436
[FR] Hors-Sujet / Re: Un RickRoll à la française?
« on: June 14, 2011, 07:38:04 am »
Tu demandes ça avec 81 posts sur omnimaga ?
T'es jamais tombé sur la vidéo de Rick Astley ?
En gros, il s'agit de piéger les gens en les envoyant vers une chanson nulle

437
News / Re: Space Invaders Lua update and Pixel Escape v0.8
« on: June 14, 2011, 06:45:44 am »
Well, there are only two words and one sentence in French, so I thought that it was not annoying for English speaking people.
But I can change that... ("Vies"=Lives, "Niveau"=Level, "Appuyez sur R pour rejouer"=Press R to try again)

And for high scores, I don't really know how to do that. I could use a var of the doc. But I would have to add a menu, and I'm lazy  :P

438
Yes it does look good, but it's only decorative.
Of course I prefer games with wonderful graphics rather than text-only games.
The picture is heavier than the code, and I think that's strange... But this is not a big problem.

439
Great !
This game looks very nice, congrats !
(But the picture on the title screen must be quite heavy and not really useful)

440
TI-Nspire / Re: [Lua] Space Invaders
« on: June 12, 2011, 07:04:35 am »
Sure !
Here it is :
Code: [Select]
function on.charIn(ch)
if ch=="r" then
blocks={5,5,5,5,5,5,5,5,5,5,5,5}
blockAttacked=0
game="notfinished"
score=0
player=100
shotX=0
shotY=0
level=1
wait=0.04
aliensDir="right"
down="no"
aliensX={}
aliensY={}
shotsX={}
shotsY={}
lives=3
for i=1,21,1 do
aliensX[i]=(i-1)%7*31+1
aliensY[i]=math.floor((i-1)/7)*25+10
shotsX[i]=aliensX[i]
shotsY[i]=200
end
end
if ch=="c" then
originalColors=not originalColors
end
end

function blocktest(x,y)
blockAttacked=0
if y>170 and y<177 then
if x>30 and x<40 and blocks[1]>0 then
blockAttacked=1
elseif x>40 and x<=50 and blocks[2]>0 then
blockAttacked=2
elseif x>50 and x<=60 and blocks[3]>0 then
blockAttacked=3
elseif x>60 and x<=70 and blocks[4]>0 then
blockAttacked=4
elseif x>140 and x<=150 and blocks[5]>0 then
blockAttacked=5
elseif x>150 and x<=160 and blocks[6]>0 then
blockAttacked=6
elseif x>160 and x<=170 and blocks[7]>0 then
blockAttacked=7
elseif x>170 and x<=180 and blocks[8]>0 then
blockAttacked=8
elseif x>250 and x<=260 and blocks[9]>0 then
blockAttacked=9
elseif x>260 and x<=270 and blocks[10]>0 then
blockAttacked=10
elseif x>270 and x<=280 and blocks[11]>0 then
blockAttacked=11
elseif x>280 and x<=290 and blocks[12]>0 then
blockAttacked=12
end
end
end


on.charIn("r")


function on.arrowLeft()
if player>0 then
player=player-10
end
end
function on.arrowRight()
if player<290 then
player=player+10
end
end
function on.tabKey()
if shotY<=0 then
shotY=195
shotX=player+13
end
end


function on.paint(gc)
if originalColors then
gc:setColorRGB(0,0,0)
gc:fillRect(0,0,platform.window:width(),platform.window:height())
end

if not originalColors then gc:setColorRGB(0,0,0)
else gc:setColorRGB(255,255,255) end
gc:setPen("thin","smooth")
gc:setFont("sansserif","r",8)
gc:drawString("Lua Alien Invaders - Par Loic Pujet",10,200,"top")

if game=="notfinished" then
if not originalColors then gc:setColorRGB(200,0,0)
else gc:setColorRGB(255,255,255) end
for i=1,21,1 do
if aliensY[i]~=0 then
gc:drawArc(aliensX[i]+4,aliensY[i]-9,10,10,0,360)
gc:fillArc(aliensX[i]-5,aliensY[i]-4,28,8,0,360)
end
end

if not originalColors then gc:setColorRGB(0,0,200)
else gc:setColorRGB(255,255,0) end
for i=1,21,1 do
if shotsY[i]<200 then
gc:fillRect(shotsX[i],shotsY[i],2,5)
end
end
if shotY>0 then
gc:fillRect(shotX,shotY,4,6)
end

if not originalColors then gc:setColorRGB(100,0,255)
else gc:setColorRGB(0,255,0) end
gc:fillRect(player,195,30,10)
gc:fillRect(player+13,191,4,4)
gc:setFont("sansserif","r",10)
gc:drawString("Vies:"..tostring(lives).." Score:"..tostring(score).." Niveau:"..tostring(level),0,0,"top")

if not originalColors then add=3
else add=0 end
for i=1,12,1 do
if blocks[i]>0 then
gc:fillRect(i*10+math.floor((i-1)/4)*70+20,180-blocks[i]*2,10,blocks[i]*2)
end
end
else
if not originalColors then gc:setColorRGB(0,0,0)
else gc:setColorRGB(255,255,255) end
gc:setFont("sansserif","b",15)
gc:drawString("Score : "..tostring(score),100,50, "top")
if not originalColors then gc:setColorRGB(0,0,255) end
gc:drawString("Appuyez sur R pour rejouer",50,150,"top")
end

timer.start(wait)
end


function on.timer()
timer.stop()

if game=="notfinished" then
if aliensDir=="right" then
for i=1,21,1 do
if aliensY[i]>0 then
aliensX[i]=aliensX[i]+1
end
end
else
for i=1,21,1 do
if aliensY[i]>0 then
aliensX[i]=aliensX[i]-1
end
end
end

if aliensDir=="right" then
for i=1,21,1 do
if aliensX[i]>305 then
down="yes"
end
end
else
for i=1,21,1 do
if aliensX[i]<15 then
down="yes"
end
end
end

if down=="yes" then
down="no"
for i=1,21,1 do
if aliensY[i]>0 then
aliensY[i]=aliensY[i]+25
end
end
if aliensDir=="left" then
aliensDir="right"
else
aliensDir="left"
end
end

for i=1,21,1 do
if aliensY[i]>180 then
game="finished"
end

if shotsY[i]>=200 and aliensY[i]~=0 then
if math.random(1,100)==5 then
shotsY[i]=aliensY[i]+math.random(1,10)
shotsX[i]=aliensX[i]
end
else
shotsY[i]=shotsY[i]+3
end

blocktest(shotsX[i],shotsY[i])
if blockAttacked>0 then
shotsY[i]=201
blocks[blockAttacked]=blocks[blockAttacked]-1
end

if shotsY[i]<200 then
if shotsY[i]>195 and shotsX[i]>player and shotsX[i]<player+30 then
lives=lives-1
shotsY[i]=200
end
end

if shotY>0 and shotY>aliensY[i]-5 and shotY<aliensY[i]+5 and shotX>aliensX[i]-10 and shotX<aliensX[i]+21 then
aliensY[i]=0
aliensX[i]=100
shotY=0
score=score+1
end
end

blocktest(shotX,shotY)
if blockAttacked>0 then
shotY=-1
blocks[blockAttacked]=blocks[blockAttacked]-1
end

if shotY>=0 then
shotY=shotY-5
end

if lives<=0 then
game="finished"
end


wintest=0
for i=1,21,1 do
wintest=wintest+aliensY[i]
end

if wintest==0 then
if wait>0.01 then
wait=wait-0.005
end
level=level+1
aliensDir="right"
down="no"
for i=1,21,1 do
aliensX[i]=(i-1)%7*31+1
aliensY[i]=math.floor((i-1)/7)*25+10
shotsX[i]=aliensX[i]
shotsY[i]=200
end
end
end

platform.window:invalidate()
end
I think that my code is pretty awful, good luck when reading it :)
(I know, I should add comments)

441
TI-Nspire / Re: [Lua] Space Invaders
« on: June 12, 2011, 06:52:15 am »
Okay, I think my game is finished. I attach the last release.
Please test this, and post here if you find any bug or problem. (By the way, the 3 shots to destroy a block are increased, now it's 5 shots)

EDIT : I removed the attachment. If you're looking for the game, see below.

442
TI-Nspire / Re: [Lua] Space Invaders
« on: June 12, 2011, 05:07:49 am »
No, not yet.
I have to forbid the player to shoot trough blocks, and to do some optimizations.
I will probably post the new release today (well, in my French day).

And sadly, I tried with sprites, and it became awfully slow.

443
TI-Nspire / Re: [Lua] Space Invaders
« on: June 11, 2011, 07:24:20 am »
(Sorry for the double post)

I've added the blocks, which hide the player.  Three shots destroy a block. (There are 12 blocks)
Do you think that it's better if the player can shoot through blocks or not ?

I attach a new screenshot

444
TI-Nspire / Re: [Lua] Space Invaders
« on: June 10, 2011, 07:33:08 am »
Thank you !
(And for the .tns, I will post it when I have added the shield blocks)

445
TI-Nspire / Re: [Lua] Space Invaders
« on: June 10, 2011, 07:15:25 am »
Great ideas !
Sorry, I didn't noticed your post before yesterday.
Well, I've added a new option : when you press the "c" key, the colors change. Actually, there are two themes : the first one that we can see in the first screenshots, and the second one which looks like the original game. (I attach a screenie) Moreover, the second one looks nicer on a CX, and the first one is more adapted for a clickpad (or touchpad)

I also fixed a bug : when the player had just 1 life, if he "caught" two shots exactly at the same time, he had -1 lives, and became invincible.
I will try to add blocks soon.

446
[FR] Programmation Axe Parser / Re: Son en Axe parser
« on: June 08, 2011, 01:51:46 pm »
Je ne crois pas que ce soit modifiable dans le code (je ne suis pas sûr du tout)
Mais en général les enceintes on un réglage du volume, non ?

447
TI-Nspire / Re: [Lua] Space Invaders
« on: June 07, 2011, 09:22:53 am »
Thank you for putting my game in the news ! :)

For the star background or more complex sprites, I'm not sure it's a really good idea.
Yes it would maybe look prettier, but I like minimalist graphics...

But if you really think that it would be better, I could try.

448
[FR] Hors-Sujet / Re: Recensement (Qui parle français?)
« on: June 06, 2011, 01:07:28 pm »
Bonjour, je suis français aussi :)
Je viens de voir ce sondage.

De toute façon quitte à parler de prog et de high-tech, je préfère parler anglais...

449
TI-Nspire / Re: [Lua] Space Invaders
« on: June 05, 2011, 01:42:38 pm »
30-days trial of Nspire computer software :)
(For the moment) the official scripting tool is unlimited...

EDIT : Ninja'd

450
TI-Nspire / Re: [Lua] Space Invaders
« on: June 05, 2011, 01:30:18 pm »
The final version is here !
I attach it in the first post, and in this post too.
It works on OS 3.0.2, as I used the official TI scripting tool, with the 30-days trial.
So thank you for all your help and replies, and I forgot to thank you for all your welcoming posts :)

Pages: 1 ... 28 29 [30] 31