Ver2guerre chasseur en chef
Nombre de messages : 3145 Age : 113 Localisation : Partout en même temps (V2g quantique) Loisirs : #pkill boulet Humeur : Happy :) items : Personalized field : 12 jetons Réputation : 8 Points : 7523 Date d'inscription : 15/09/2007
Profil TI: (TI-89Tita)^2+TI83Plus TO: 50 [2380 - 2%] {54} Spécialité: Autres
| Sujet: wow() (2) Dim 13 Jan 2008, 19:59 | |
| Voilà la partie du code que j'ai commencé à programmer : - Citation :
- :wow()
:Prgm :"t"&string(yt)&"t"&string(xt)->t :If h!=0 :"h"&string(h)&t->t Permet de règler "l'étage" du batiment :#t->t L'indirection est ici et pas avant, parce-que c'est comme ça. :ClrDraw :PxlVert 131 tout l'arrangement graphique de l'écran de jeu Ajout d'un ou de plusieurs éventuels objets récoltables. :rand(rand(rand(4)))-1->nbobj choix du nombre d'objets qui apparaîtront sur la carte :For i,1,nbobj :rand(11)+2->xo choix aléatoire des coordonnées des objets. :rand(5)+2->yo Le +2 est là pour éviter que l'objet soit sur un bord, et que le bonhomme apparaisse dessus après un changement de terrain. :If t[yo,xo]="0" Then Vérification de la disponibilité de la case choisie :"a"&alphabet[rand(round(racine(((yt/ymax)^2+(xt/xmax)^2)/2)*5,0))]&"3"->t[yo,xo] Magnifique ligne de code... Elle permet de limiter les objets à un faible niveau aux abords de la zone de départ, et d'avoir toujours plus de chances d'avoir un objet élevé en s'éloignant de cette zone. :Else :i-1->i :EndIf :EndFor Affichage du terrain, et jolie barre de chargement :For i,70,76 :PxlHorz i :EndFor :-49->a :For u,2,9 :For v,2,14 :t[u,v]->z :If z!="0" != : différent :RclPic #z,(u-2)*10,(v-2)*10 :If a>=0 >= : supérieur ou égal :PxlCrcl 73,a,3,0 :a+2->a :EndFor :EndFor Fin de l'affichage du terrain. On passe au déplacement du bonhomme :Loop :RclPic bonhomme,10*(yp-2),10*(xp-2) :0->gk :While gk=0 :getKey()->gk :EndWhile :XorPic bonhomme,10*(yp-2),10*(xp-2) efface le bonhomme de sa position initiale :If gk=340 Then touche de droite :If right(t[yp, xp+1],1)!="1" test si la case n'est pas un obstacle : xp+1->xp :If right(t[yp,xp],1)="2" :fight() Lance le programme de combat :If right(t[yp,xp],1)="3" :inv(1) Lance le programme de gestion de l'inventaire :EndIf :ElseIf gk=337 Then :If right(t[yp,xp-1],1)!="1" Then :xp-1->xp :If right(t[yp,xp],1)="2" Then :If left(t[yp,xp],1)="a" Then :fight() :Else :0->h :If left(t[yp,xp],1)="b" :1->h :Exit :EndIf :EndIf
:XorPic bonhomme, 10*(yp-1),10*(xp-1) et on recommence :If t[yp, xp-1]=0 : xp-1->xp :ElseIf gk=344 Then :XorPic bonhomme, 10*(yp-1),10*(xp-1) :If t[yp+1, xp]=0 :yp+1->yp :ElseIf gk=338 Then :XorPic bonhomme, 10*(yp-1),10*(xp-1) :If t[yp-1, xp]=0 :yp-1->yp :EndIf
:If xp=0 or xp=14 or yp=0 or yp=8 :Exit :EndLoop :EndPrgm
Dernière édition par Ver2guerre le Mer 14 Mai 2008, 20:47, édité 5 fois (Raison : ajout de code.) |
|
tama Admin
Nombre de messages : 12376 Age : 32 Localisation : DTC ? :triso: Humeur : =) items : o Personalized field : huh ? oO Réputation : 3 Points : 9434 Date d'inscription : 08/08/2007
Profil TI: 84+, 89 tita, 89 tita TO: infini :p Spécialité: C 68k
| Sujet: Re: wow() (2) Dim 13 Jan 2008, 22:37 | |
| [HS]CHANGE LA COULEUR DE TES COMMENTAIRES O_o[/HS]
sinon encore une fois, en lisant vite fait, je vois rien |
|
tama Admin
Nombre de messages : 12376 Age : 32 Localisation : DTC ? :triso: Humeur : =) items : o Personalized field : huh ? oO Réputation : 3 Points : 9434 Date d'inscription : 08/08/2007
Profil TI: 84+, 89 tita, 89 tita TO: infini :p Spécialité: C 68k
| Sujet: Re: wow() (2) Ven 18 Jan 2008, 18:33 | |
| indentation : - Code:
-
For z,1,1000 Disp "Bonjour" EndFor
sans indentation : - Code:
-
For z,1,1000 Disp "Bonjour" EndFor
cool le menu :) |
|