π
<-

Modifier la "pause" d'un snake

:32ti73: :32ti73e: :32ti73e2: :32ti76f: :32ti80: :32ti81: :32ti82: :32ti85: :32ti86: :32ti82s: :32ti82sf: :32ti82sfn: :32ti83: :32ti83p: :32ti83pb: :32ti83pr: :32ti83pfr: :32ti83pse: :32ti84p: :32ti84pse: :32ti84ppse: :32ti84pfr: :32ti84pcse: :32ti83pfrusb: :32ti82p: :32ti82a: :32ti84pce: :32ti83pce:

Modifier la "pause" d'un snake

Unread postby chips93 » 20 Oct 2012, 14:23

Bonjour, voila j'ai un snake que je trouve très bien, je voudrais juste modifier la pause,
je voudrais créer un menu pause.
La pour mettre pause il faut que j'appuie sur [2nde] puis [entrer] pour reprendre.
Moi je veux que quand j'appuie sur [entrer] sa met en pause le jeu et sa me propose deux choix:
1: continuer
2: quitter.

Voila merci si vous pouvez m'aider, moi j'ai essayer, mais le jeu ne fonctionne plus quand je modifier la pause, il fait des erreurs.

voici le jeu :
ü veut dire la fleche sto
Code: Select all
ClrHome
Output(1,3,"SNAKE  PAR
Output(3,8,"DANIEL
Output(5,6,"EMERY
Output(8,2,"HIGH SCORE:
Output(8,14,ZÖMin
Normal
PlotsOff
AxesOff
FnOff
GridOff
For(A,1,999
End
0üXmin
94üXmax
0üYmin
62üYmax
0üN
0üP
0üO
39üdim(áY
1üM
ClrDraw
Lbl 0
Repeat 0
Fill(99,áY
áYüáX
49üB
47üA
34üD
1üE
10üL
0üH
0üI
Horizontal 0
Horizontal 1
Horizontal 2
Horizontal 60
Horizontal 61
Horizontal 62
Vertical 0
Vertical 1
Vertical 2
Vertical 3
Vertical 91
Vertical 92
Vertical 93
Vertical 94
getKey
While M
While H
While not(I)D=24
DüC
Repeat Ans+I
A-3üA
pxl-Test(61-B,AüI
Pt-On(A,B,2
AüáY(E
BüáX(E
1+E(EøLüE
Pt-Off(áY(E),áX(E),2
getKey
End
AnsüD
End
While not(I)(D=25
DüC
Repeat Ans+I
B+3üB
pxl-Test(61-B,AüI
Pt-On(A,B,2
AüáY(E
BüáX(E
1+E(EøLüE
Pt-Off(áY(E),áX(E),2
getKey
End
AnsüD
End
While not(I)(D=26
DüC
Repeat Ans+I
A+3üA
pxl-Test(61-B,AüI
Pt-On(A,B,2
AüáY(E
BüáX(E
1+E(EøLüE
Pt-Off(áY(E),áX(E),2
getKey
End
AnsüD
End
While not(I)(D=34
DüC
Repeat Ans+I
B-3üB
pxl-Test(61-B,AüI
Pt-On(A,B,2
AüáY(E
BüáX(E
1+E(EøLüE
Pt-Off(áY(E),áX(E),2
getKey
End
AnsüD
End
If D=21
Pause
If D=45
Then
Lbl 2
ClrHome
Output(2,7,"GAME
Output(3,7,"OVER
Lbl 3
ClrDraw
10N+(L-10)/3+OüO
If O>ZÖMin
Then
OüZÖMin
Output(5,3,"NOUV. HIGH
End
Output(6,5,"SCORE:
Output(6,11,O
DelVar áX
DelVar áY
Return
End
If I
Then
If A=J and B=K
Then
Pt-Off(J,K
L+3üL
0üI
0üH
Else
For(A,3,31
Horizontal A
Horizontal 62-A
End
P+1üP
If P=3
Goto 2
(L-10)/3+OüO
0üM
N-1üN
Goto 0
End
End
If D<24 or D>26 and Dø34
CüD
End
While not(H
1+3randInt(1,19üK
2+3randInt(1,29üJ
not(pxl-Test(62-K,J+1üH
End
Pt-On(J,K,3
If L=40
0üM
0üI
End
ClrDraw
N+1üN
If N=7
Then
ClrHome
Output(1,4,"BRAVO!!!
Output(3,2,"TU A GAGNE!!
Goto 3
End
If N
{32,9,32,53,62,9,62,53üáX
If N>1
augment(áX,{34,52,60,52,34,10,42,10,52,10,60,10üáX
If N>2
augment(áX,{2,31,12,31,22,31,42,31,52,31,72,31,82,31,90,31üáX
If N>3
augment(áX,{2,52,12,52,22,52,72,52,82,52,90,52,2,10,12,10,22,10,42,10,52,10,72,10,82,10,92,10üáX
If N>4
augment(áX,{11,41,11,21,23,41,23,21,71,41,71,21,83,41,83,21üáX
If N>5
augment(áX,{41,41,41,21,53,41,53,21üáX
If 99-áX(1
Then
For(X,1,dim(áX),4
áX(XüA
áX(X+1üB
áX(X+2üC
áX(X+3üD
If A=C
Then
Line(A-1,B,A-1,D
Line(A+1,B,A+1,D
Else
Line(A,B-1,C,B-1
Line(A,B+1,C,B+1
End
Line(A,B,C,D
End
End
1üM
End


et voici la pause que je voudrais mettre en remplacent l'autre:

Code: Select all
If Kø0:Then
If K=105:Then
Menu("PAUSED:","CONTINUE",C,"QUIT",Z)
Lbl C
getKeyüK
DispGraph
End



Il faudrait changer la variable, pour mettre la meme que celle de snake, je sais pas si c'est ça:

Code: Select all
If Dø0:Then
If D=105:Then
Menu("PAUSED:","CONTINUE",C,"QUIT",Z)
Lbl C
getKeyüD
DispGraph
End



Après je sais pas comment faire.


Merci d'avance pour votre aide.
User avatar
chips93
Niveau 6: SM (Super Membre)
Niveau 6: SM (Super Membre)
Level up: 71.4%
 
Posts: 6
Joined: 20 Oct 2012, 14:15
Gender: Not specified
Calculator(s):
MyCalcs profile
Class: 1ere S

Re: Modifier la "pause" d'un snake

Unread postby critor » 20 Oct 2012, 14:33

Oui donc quel est le problème?

Ton travail d'analyse a l'air bien jusqu'à présent.
Image
User avatar
critorAdmin
Niveau 19: CU (Créateur Universel)
Niveau 19: CU (Créateur Universel)
Level up: 53.5%
 
Posts: 42395
Images: 17115
Joined: 25 Oct 2008, 00:00
Location: Montpellier
Gender: Male
Calculator(s):
MyCalcs profile
YouTube: critor3000
Twitter: critor2000
GitHub: critor

Re: Modifier la "pause" d'un snake

Unread postby chips93 » 20 Oct 2012, 14:38

Bha comme je débute, je sais pas ou mettre la pause,

parce que j'ai essayé de la mettre a cette ligne, pour remplacer l'actuelle pause,
Code: Select all
If D=21
Pause


Met après le jeu beug, ne fonctionne plus.
User avatar
chips93
Niveau 6: SM (Super Membre)
Niveau 6: SM (Super Membre)
Level up: 71.4%
 
Posts: 6
Joined: 20 Oct 2012, 14:15
Gender: Not specified
Calculator(s):
MyCalcs profile
Class: 1ere S

Re: Modifier la "pause" d'un snake

Unread postby critor » 20 Oct 2012, 14:41

C'est peut-être juste parce que tu as oublié de fermer ton If.

Code: Select all
If K=105
Then
Menu("PAUSED:","CONTINUE",C,"QUIT",Z)
End
Lbl C
...
Image
User avatar
critorAdmin
Niveau 19: CU (Créateur Universel)
Niveau 19: CU (Créateur Universel)
Level up: 53.5%
 
Posts: 42395
Images: 17115
Joined: 25 Oct 2008, 00:00
Location: Montpellier
Gender: Male
Calculator(s):
MyCalcs profile
YouTube: critor3000
Twitter: critor2000
GitHub: critor

Re: Modifier la "pause" d'un snake

Unread postby chips93 » 20 Oct 2012, 14:47

A ça fonctionne, juste quand je fait quitter
sa me fait
ERR:ETIQUETTE

je fait annuler sa quitte, mais pourquoi sa fait une erreur ?
User avatar
chips93
Niveau 6: SM (Super Membre)
Niveau 6: SM (Super Membre)
Level up: 71.4%
 
Posts: 6
Joined: 20 Oct 2012, 14:15
Gender: Not specified
Calculator(s):
MyCalcs profile
Class: 1ere S

Re: Modifier la "pause" d'un snake

Unread postby critor » 20 Oct 2012, 14:49

Cela voudrait dire que tu n'as pas d'instruction "Lbl Z" dans ton programme, qui est l'étiquette où doit sauter l'exécution de code pour quitter.

Habituellement, on met ça à la dernière ligne du programme: comme ça ça va à "Lbl Z", et comme y'a plus de ligne de code après ça quitte.
Image
User avatar
critorAdmin
Niveau 19: CU (Créateur Universel)
Niveau 19: CU (Créateur Universel)
Level up: 53.5%
 
Posts: 42395
Images: 17115
Joined: 25 Oct 2008, 00:00
Location: Montpellier
Gender: Male
Calculator(s):
MyCalcs profile
YouTube: critor3000
Twitter: critor2000
GitHub: critor

Re: Modifier la "pause" d'un snake

Unread postby chips93 » 20 Oct 2012, 14:56

Alors a la dernière ligne du programme je met
Lbl Z

je met pas de end a la fin ?

Ah la quand j'appuie sur "annuler" le jeu quitte, ce terminer, on pourrait pas elever cette touche ?
puisque pour quitter maintenant il faut aller sur le menu [entrer]

Merci de tes réponse, tu ma déjà bien aidé
User avatar
chips93
Niveau 6: SM (Super Membre)
Niveau 6: SM (Super Membre)
Level up: 71.4%
 
Posts: 6
Joined: 20 Oct 2012, 14:15
Gender: Not specified
Calculator(s):
MyCalcs profile
Class: 1ere S

Re: Modifier la "pause" d'un snake

Unread postby critor » 20 Oct 2012, 21:59

Oui: "Lbl Z" en dernière ligne du programme, rien d'autre.

Oui, tu peux supprimer la touche "annuler".
Elle a pour code 45 (4ème ligne, 5ème colonne).
Cherche donc 45 dans le code du programme.
Image
User avatar
critorAdmin
Niveau 19: CU (Créateur Universel)
Niveau 19: CU (Créateur Universel)
Level up: 53.5%
 
Posts: 42395
Images: 17115
Joined: 25 Oct 2008, 00:00
Location: Montpellier
Gender: Male
Calculator(s):
MyCalcs profile
YouTube: critor3000
Twitter: critor2000
GitHub: critor

Re: Modifier la "pause" d'un snake

Unread postby chips93 » 21 Oct 2012, 13:57

voila la version modifier

Code: Select all
ClrHome
Output(1,3,"SNAKE  PAR
Output(3,8,"DANIEL
Output(5,6,"EMERY
Output(8,2,"HIGH SCORE:
Output(8,14,ZÖMin
Normal
PlotsOff
AxesOff
FnOff
GridOff
For(A,1,999
End
0üXmin
94üXmax
0üYmin
62üYmax
0üN
0üP
0üO
39üdim(áY
1üM
ClrDraw
Lbl 0
Repeat 0
Fill(99,áY
áYüáX
49üB
47üA
34üD
1üE
10üL
0üH
0üI
Horizontal 0
Horizontal 1
Horizontal 2
Horizontal 60
Horizontal 61
Horizontal 62
Vertical 0
Vertical 1
Vertical 2
Vertical 3
Vertical 91
Vertical 92
Vertical 93
Vertical 94
getKey
While M
While H
While not(I)D=24
DüC
Repeat Ans+I
A-3üA
pxl-Test(61-B,AüI
Pt-On(A,B,2
AüáY(E
BüáX(E
1+E(EøLüE
Pt-Off(áY(E),áX(E),2
getKey
End
AnsüD
End
While not(I)(D=25
DüC
Repeat Ans+I
B+3üB
pxl-Test(61-B,AüI
Pt-On(A,B,2
AüáY(E
BüáX(E
1+E(EøLüE
Pt-Off(áY(E),áX(E),2
getKey
End
AnsüD
End
While not(I)(D=26
DüC
Repeat Ans+I
A+3üA
pxl-Test(61-B,AüI
Pt-On(A,B,2
AüáY(E
BüáX(E
1+E(EøLüE
Pt-Off(áY(E),áX(E),2
getKey
End
AnsüD
End
While not(I)(D=34
DüC
Repeat Ans+I
B-3üB
pxl-Test(61-B,AüI
Pt-On(A,B,2
AüáY(E
BüáX(E
1+E(EøLüE
Pt-Off(áY(E),áX(E),2
getKey
End
AnsüD
End
If D=105
Then
Menu("PAUSE:","CONTINUER",C,"QUITTER",2)
End
Lbl C
If D=45
Then
Lbl 2
ClrHome
Output(2,7,"GAME
Output(3,7,"OVER
Lbl 3
ClrDraw
10N+(L-10)/3+OüO
If O>ZÖMin
Then
OüZÖMin
Output(5,3,"NOUV. HIGH
End
Output(6,5,"SCORE:
Output(6,11,O
DelVar áX
DelVar áY
Return
End
If I
Then
If A=J and B=K
Then
Pt-Off(J,K
L+3üL
0üI
0üH
Else
For(A,3,31
Horizontal A
Horizontal 62-A
End
P+1üP
If P=3
Goto 2
(L-10)/3+OüO
0üM
N-1üN
Goto 0
End
End
If D<24 or D>26 and Dø34
CüD
End
While not(H
1+3randInt(1,19üK
2+3randInt(1,29üJ
not(pxl-Test(62-K,J+1üH
End
Pt-On(J,K,3
If L=40
0üM
0üI
End
ClrDraw
N+1üN
If N=7
Then
ClrHome
Output(1,4,"BRAVO!!!
Output(3,2,"TU A GAGNE!!
Goto 3
End
If N
{32,9,32,53,62,9,62,53üáX
If N>1
augment(áX,{34,52,60,52,34,10,42,10,52,10,60,10üáX
If N>2
augment(áX,{2,31,12,31,22,31,42,31,52,31,72,31,82,31,90,31üáX
If N>3
augment(áX,{2,52,12,52,22,52,72,52,82,52,90,52,2,10,12,10,22,10,42,10,52,10,72,10,82,10,92,10üáX
If N>4
augment(áX,{11,41,11,21,23,41,23,21,71,41,71,21,83,41,83,21üáX
If N>5
augment(áX,{41,41,41,21,53,41,53,21üáX
If 99-áX(1
Then
For(X,1,dim(áX),4
áX(XüA
áX(X+1üB
áX(X+2üC
áX(X+3üD
If A=C
Then
Line(A-1,B,A-1,D
Line(A+1,B,A+1,D
Else
Line(A,B-1,C,B-1
Line(A,B+1,C,B+1
End
Line(A,B,C,D
End
End
1üM
End
User avatar
chips93
Niveau 6: SM (Super Membre)
Niveau 6: SM (Super Membre)
Level up: 71.4%
 
Posts: 6
Joined: 20 Oct 2012, 14:15
Gender: Not specified
Calculator(s):
MyCalcs profile
Class: 1ere S

Re: Modifier la "pause" d'un snake

Unread postby critor » 21 Oct 2012, 14:01

C'est la version modifiée avec la touche annuler supprimée?

Pourtant je vois toujours le "If D=45" dedans...
Image
User avatar
critorAdmin
Niveau 19: CU (Créateur Universel)
Niveau 19: CU (Créateur Universel)
Level up: 53.5%
 
Posts: 42395
Images: 17115
Joined: 25 Oct 2008, 00:00
Location: Montpellier
Gender: Male
Calculator(s):
MyCalcs profile
YouTube: critor3000
Twitter: critor2000
GitHub: critor

Next

Return to Problèmes divers / Aide débutants

Who is online

Users browsing this forum: ClaudeBot [spider] and 19 guests

-
Search
-
Social TI-Planet
-
Featured topics
Comparaisons des meilleurs prix pour acheter sa calculatrice !
"1 calculatrice pour tous", le programme solidaire de Texas Instruments. Reçois gratuitement et sans aucune obligation d'achat, 5 calculatrices couleur programmables en Python à donner aux élèves les plus nécessiteux de ton lycée. Tu peux recevoir au choix 5 TI-82 Advanced Edition Python ou bien 5 TI-83 Premium CE Edition Python.
Enseignant(e), reçois gratuitement 1 exemplaire de test de la TI-82 Advanced Edition Python. À demander d'ici le 31 décembre 2024.
Aidez la communauté à documenter les révisions matérielles en listant vos calculatrices graphiques !
1234
-
Donations / Premium
For more contests, prizes, reviews, helping us pay the server and domains...
Donate
Discover the the advantages of a donor account !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partner and ad
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
2469 utilisateurs:
>2423 invités
>39 membres
>7 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)
-
Other interesting websites
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)