Annonce

>>> Bienvenue sur codelab! >>> Première visite ? >>> quelques mots sur codelab //// une carte des membres//// (apéros) codelab


#1 2010-12-17 14:54:46 Simuler un pong avec l'objet Matrixctrl.

tobald
modérateur
Date d'inscription: 2008-03-28
Messages: 499

Simuler un pong avec l'objet Matrixctrl.



Hello

Pensez vous qu'il soit possible de simuler des trajectoires cohérentes d'une balle rebondissante comme dans l'antédiluvien PONG à l'aide de l'objet matrixctrl ? (Pas la matrix jitter)

J'y parviens plus ou moins à l'aide d'un système peu élégant mais les trajectoires ne sont pas réalistes et n'ont aucune interaction avec la façon dont elles touchent les raquettes. (que j'ai codé sans probs)

Je posterais le patch ce soir

Thnx !

Hors ligne

 

#2 2010-12-17 16:26:15 Re : Simuler un pong avec l'objet Matrixctrl.

Staross
membre
Date d'inscription: 2008-04-03
Messages: 322

Re: Simuler un pong avec l'objet Matrixctrl.



Tu veux dessiner la balle sur le matrixctrl, c'est ca ?

Ca va toujours faire des trajectoires en escaliers...

Hors ligne

 

#3 2010-12-17 17:01:29 Re : Simuler un pong avec l'objet Matrixctrl.

tobald
modérateur
Date d'inscription: 2008-03-28
Messages: 499

Re: Simuler un pong avec l'objet Matrixctrl.



T'as compris le problême. Après tu peux faire varier l'amplitude de escaliers avec un système à la con genre des [random]  sur des  [+1] / [+2] ; / [-1] / [-2]; . Mais pour qu'il y ait une cohérence avec l'impact de la raquette (et que la balle fasse des touts droits) ça risque d'être chaud.

utiliser un metro et un counter pour faire des allers et retours n'étant pas le plus dur smile

Je crois que c'est plutot quelqchose à faire en java , donc mort pour moi.

L'idée c'est de faire un pong pour un controlleur style monome.

Hors ligne

 

#4 2010-12-17 20:37:26 Re : Simuler un pong avec l'objet Matrixctrl.

pschiiitt
membre
Date d'inscription: 2009-03-21
Messages: 318

Re: Simuler un pong avec l'objet Matrixctrl.



Salut,

Tu veux un truc dans ce goût là :
http://codelab.fr/up/Image-1-5.png
peut-être ?

Hors ligne

 

#5 2010-12-18 16:55:50 Re : Simuler un pong avec l'objet Matrixctrl.

tobald
modérateur
Date d'inscription: 2008-03-28
Messages: 499

Re: Simuler un pong avec l'objet Matrixctrl.



Même si ça me frustre de pas avoir trouvé tout seul  , je dois bien dire que tu es formidable Pschiiit big_smile.
Je vais décrypter un peu ce patch, j'avais même pas pensé à l'objet trigger .... shame on me.

Il ne me reste plus qu'a coder la partie qui définit si la balle est rattrapée ou non.

Vraiment merci , j'ai passé des nuits à galérer pour un résultat nettement moins efficace.

Hors ligne

 

#6 2010-12-20 21:57:41 Re : Simuler un pong avec l'objet Matrixctrl.

pschiiitt
membre
Date d'inscription: 2009-03-21
Messages: 318

Re: Simuler un pong avec l'objet Matrixctrl.



C'est un plaisir de rendre service, mais je comprends aussi ta frustration.

Tu peux supprimer un des bords en posant un [gate] qui coupe la condition d'incrémentation par exemple, ou mettre un modulo [%16] pour la faire revenir sur le bord opposé...

Bon jeu !

Hors ligne

 

#7 2010-12-20 22:48:27 Re : Simuler un pong avec l'objet Matrixctrl.

tobald
modérateur
Date d'inscription: 2008-03-28
Messages: 499

Re: Simuler un pong avec l'objet Matrixctrl.



Hello Pschiiit

J'ai juste modifié un peu le patch pour avoir plus de variantes de trajectoires en alternant les valeurs d'incrementation. Je cherche encore une méthode pour plus de "flexibilité"

http://codelab.fr/up/var-1.JPG

J'utilise trois matrices (raquette 1 , balle, raquette 2) . Chaque raquette utilisant 3 points de la matrix , je cherche un moyen simple de coder la "reconaisse de collision / non collision" . je pense utiliser l'objet [split]

Je joins le patch si tu veux voir à quoi ça ressemble (l'ajoute de piece jointe semble bugger , désolé pour la longueur du texte)

encore merci pour le coup de main.


max v2;
#N vpatcher 15 55 1585 927;
#P window setfont "Sans Serif" 14.;
#P comment 1139 293 100 9109518 PLAYER 2;
#P window setfont "Sans Serif" 12.;
#P comment 138 605 64 9109516 MIDIOUT;
#P window setfont "Sans Serif" 9.;
#P number 372 479 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 262 603 33 9109513 del 50;
#N vpatcher 566 269 1470 911;
#P origin 0 12;
#P window setfont "Sans Serif" 9.;
#P newex 118 94 40 9109513 s metro;
#P newex 118 69 27 9109513 * 7;
#P number 103 38 35 9 50 700 3 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#N vpatcher 15 55 615 455;
#P window setfont "Sans Serif" 9.;
#P newex 158 68 38 9109513 r metro;
#P outlet 205 317 15 0;
#P newex 215 251 82 9109513 if ($i1>=7) then -1;
#P button 52 97 15 0;
#P button 84 170 15 0;
#P message 84 196 14 9109513 3;
#P button 66 171 15 0;
#P message 66 196 14 9109513 2;
#P button 50 170 15 0;
#P message 50 196 14 9109513 1;
#P newex 52 140 53 9109513 route 0 1 2;
#P toggle 52 50 15 0;
#P newex 52 72 55 9109513 metro 2800;
#P newex 63 219 40 9109513 gate 3;
#P newex 52 116 47 9109513 random 3;
#P newex 125 265 82 9109513 if ($i1>=7) then -1;
#P newex 63 289 82 9109513 if ($i1>=7) then -1;
#P inlet 52 30 15 0;
#P inlet 105 204 15 0;
#P outlet 124 319 15 0;
#P outlet 62 325 15 0;
#P connect 10 0 12 0;
#P connect 12 0 11 0;
#P connect 3 0 9 0;
#P connect 9 0 8 0;
#P connect 8 0 17 0;
#P connect 17 0 6 0;
#P connect 6 0 10 0;
#P connect 4 0 0 0;
#P connect 11 0 7 0;
#P connect 13 0 7 0;
#P connect 15 0 7 0;
#P connect 7 0 4 0;
#P connect 10 1 14 0;
#P connect 14 0 13 0;
#P connect 10 2 16 0;
#P connect 16 0 15 0;
#P connect 2 0 7 1;
#P connect 20 0 8 1;
#P connect 5 0 1 0;
#P connect 7 1 5 0;
#P connect 18 0 19 0;
#P connect 7 2 18 0;
#P pop;
#P newobj 419 127 40 9109513 p var2;
#P number 76 269 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 335 185 27 9109513 + 0;
#P newex 299 237 136 9109513 t i i i i;
#P newex 299 211 30 9109513 i;
#P newex 319 149 47 9109513 random 7;
#P newex 302 125 47 9109513 random 7;
#P newex 274 23 45 9109513 loadbang;
#P newex 302 71 27 9109513 t b b;
#P button 302 45 15 0;
#P newex 183 205 79 9109513 if ($i1<=0) then 1;
#P newex 81 140 27 9109513 + 0;
#P newex 100 205 82 9109513 if ($i1>=7) then -1;
#P message 50 325 65 9109513 clear \, \$1 \$2 1;
#P newex 50 292 259 9109513 pack;
#P newex 50 243 85 9109513 t i i i i;
#P newex 50 212 27 9109513 i;
#P newex 50 95 27 9109513 t b b;
#P newex 50 67 50 9109513 metro 400;
#P toggle 50 45 15 0;
#P outlet 50 347 15 0;
#P window linecount 0;
#N vpatcher 15 55 362 506;
#P window setfont "Sans Serif" 9.;
#P newex 97 39 38 9109513 r metro;
#P button 52 97 15 0;
#P button 84 170 15 0;
#P message 84 196 14 9109513 3;
#P button 66 170 15 0;
#P message 66 196 14 9109513 2;
#P button 50 170 15 0;
#P message 50 196 14 9109513 1;
#P newex 52 140 53 9109513 route 0 1 2;
#P toggle 52 50 15 0;
#P newex 52 72 55 9109513 metro 2800;
#P newex 63 224 40 9109513 gate 3;
#P newex 52 116 47 9109513 random 3;
#P newex 123 274 79 9109513 if ($i1<=0) then 2;
#P newex 78 314 79 9109513 if ($i1<=0) then 0;
#P newex 2 277 79 9109513 if ($i1<=0) then 1;
#P inlet 52 30 15 0;
#P inlet 122 188 15 0;
#P outlet 95 359 15 0;
#P outlet 78 359 15 0;
#P outlet 62 359 15 0;
#P comment 112 359 100 9109513 outlet vers [+ 0];
#P comment 108 72 100 9109513 << frŽquence du random = vitesse de la balle * nombre de colonnes;
#P comment 205 275 100 9109513 < variantes d'incrŽmentation (0= tir horizontal);
#P comment 141 188 100 9109513 < [ t i i i];
#P fasten 13 0 9 0 68 260 7 260;
#P connect 16 0 18 0;
#P connect 18 0 17 0;
#P connect 8 0 15 0;
#P connect 15 0 14 0;
#P connect 14 0 23 0;
#P connect 23 0 12 0;
#P connect 12 0 16 0;
#P fasten 9 0 4 0 7 327 67 327;
#P connect 21 0 13 0;
#P connect 19 0 13 0;
#P connect 17 0 13 0;
#P connect 16 1 20 0;
#P connect 20 0 19 0;
#P connect 13 1 10 0;
#P connect 10 0 5 0;
#P connect 16 2 22 0;
#P connect 22 0 21 0;
#P connect 7 0 13 1;
#P fasten 11 0 6 0 128 309 100 309;
#P connect 24 0 14 1;
#P fasten 13 2 11 0 98 258 128 258;
#P pop;
#P newobj 375 127 40 9109513 p var1;
#P comment 474 130 100 9109513 < variantes de trajectoire;
#P connect 3 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 6 0;
#P connect 6 0 7 0;
#P connect 7 0 8 0;
#P connect 8 0 9 0;
#P connect 9 0 2 0;
#P connect 11 0 6 1;
#P connect 16 0 6 1;
#P connect 7 0 21 0;
#P connect 7 1 11 0;
#P lcolor 5;
#P connect 23 0 4 1;
#P connect 10 0 11 1;
#P lcolor 8;
#P connect 12 0 11 1;
#P lcolor 8;
#P connect 7 2 10 0;
#P lcolor 6;
#P connect 23 0 24 0;
#P connect 24 0 25 0;
#P connect 7 3 12 0;
#P lcolor 6;
#P fasten 5 1 18 0 72 133 304 133;
#P connect 18 0 19 0;
#P connect 19 0 8 1;
#P connect 15 0 14 0;
#P connect 13 0 14 0;
#P connect 14 0 16 0;
#P connect 14 1 17 0;
#P fasten 20 0 18 1 340 207 324 207;
#P connect 17 0 18 1;
#P connect 19 1 20 0;
#P lcolor 5;
#P connect 1 0 20 1;
#P connect 1 1 20 1;
#P connect 1 2 20 1;
#P connect 22 1 20 1;
#P connect 22 0 20 1;
#P connect 22 2 20 1;
#P fasten 3 0 1 0 55 93 380 93;
#P fasten 19 3 1 1 430 317 467 317 467 65 410 65;
#P fasten 3 0 22 0 55 93 424 93;
#P fasten 19 2 22 1 388 317 467 317 467 65 454 65;
#P pop;
#P newobj 262 245 30 9109513 p ball;
#P message 126 530 50 9109513 3;
#P newex 126 487 57 9109513 prepend set;
#P newex 392 580 59 9109513 r mididevice;
#P newex 380 612 46 9109513 midiout;
#P toggle 416 471 15 0;
#P newex 292 456 27 9109513 * 8;
#P newex 337 474 27 9109513 + 0;
#P newex 380 551 66 9109513 xnoteout;
#P button 262 478 15 0;
#P newex 292 434 135 9109513 unpack 0 0 0;
#P message 348 541 19 9109513 56;
#P newex 337 500 57 9109513 prepend set;
#P user matrixctrl 262 271 131 130 MatrixDefaultCell.pct MatrixDefaultBkgnd.pct 131 130 16 16 8 8 16 16 1 1 52 2 5120 0;
#P newex 513 491 27 9109513 + 56;
#P button 572 500 15 0;
#P button 551 499 15 0;
#P message 572 518 18 9109513 64;
#P message 551 520 14 9109513 0;
#P newex 553 468 45 9109513 route 0 1;
#P number 553 443 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 430 242 34 9109513 r grid2;
#P newex 514 545 40 9109513 noteout;
#P number 513 442 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 476 441 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 475 408 62 9109513 unpack 0 0 0;
#P user matrixctrl 430 271 131 130 MatrixDefaultCell.pct MatrixDefaultBkgnd.pct 131 130 16 16 8 8 16 16 1 1 49 2 5120 0;
#P window setfont "Sans Serif" 12.;
#P number 1130 271 106 12 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 9.;
#P newex 1130 247 79 9109513 scale 0 127 6 1;
#P newex 1130 377 92 9109513 route 1 2 3 4 5 6;
#P newex 1130 224 33 9109513 ctlin 5;
#P button 1212 419 15 0;
#P button 1196 419 15 0;
#P button 1180 419 15 0;
#P message 1033 654 29 9109513 7 7 0;
#B color 5;
#P message 1033 616 29 9109513 7 6 0;
#B color 5;
#P message 1033 582 29 9109513 7 5 0;
#B color 5;
#P message 1033 556 29 9109513 7 4 0;
#B color 5;
#P message 1033 529 29 9109513 7 3 0;
#B color 5;
#P message 1033 498 29 9109513 7 2 0;
#B color 5;
#P message 1033 470 29 9109513 7 1 0;
#B color 5;
#P button 1164 419 15 0;
#P message 1033 445 29 9109513 7 0 0;
#B color 5;
#P button 1147 419 15 0;
#P button 1131 419 15 0;
#P newex 1171 569 36 9109513 s grid2;
#P message 1368 509 29 9109513 7 7 1;
#B color 5;
#P message 1338 509 29 9109513 7 6 1;
#B color 5;
#P message 1308 509 29 9109513 7 5 1;
#B color 5;
#P message 1277 509 29 9109513 7 4 1;
#B color 5;
#P message 1246 509 29 9109513 7 3 1;
#B color 5;
#P message 1215 509 29 9109513 7 2 1;
#B color 5;
#P message 1185 509 29 9109513 7 1 1;
#B color 5;
#P message 1154 509 29 9109513 7 0 1;
#B color 5;
#P button 209 502 15 0;
#P button 188 501 15 0;
#P message 209 520 18 9109513 64;
#P message 188 522 14 9109513 0;
#P newex 190 470 45 9109513 route 0 1;
#P number 190 445 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 14.;
#P number 798 273 109 14 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 9.;
#P newex 798 241 79 9109513 scale 0 127 6 1;
#P newex 798 388 92 9109513 route 1 2 3 4 5 6;
#P newex 798 217 38 9109513 ctlin 14;
#P button 880 430 15 0;
#P button 864 430 15 0;
#P button 848 430 15 0;
#P message 701 665 29 9109513 0 7 0;
#B color 4;
#P message 701 627 29 9109513 0 6 0;
#B color 4;
#P message 701 593 29 9109513 0 5 0;
#B color 4;
#P message 701 567 29 9109513 0 4 0;
#B color 4;
#P message 701 540 29 9109513 0 3 0;
#B color 4;
#P message 701 509 29 9109513 0 2 0;
#B color 4;
#P message 701 481 29 9109513 0 1 0;
#B color 4;
#P button 832 430 15 0;
#P message 701 456 29 9109513 0 0 0;
#B color 4;
#P button 815 430 15 0;
#P newex 112 241 29 9109513 r grid;
#P button 799 430 15 0;
#P newex 839 580 31 9109513 s grid;
#P message 983 490 29 9109513 0 7 1;
#B color 4;
#P message 953 490 29 9109513 0 6 1;
#B color 4;
#P message 923 490 29 9109513 0 5 1;
#B color 4;
#P message 892 490 29 9109513 0 4 1;
#B color 4;
#P message 861 490 29 9109513 0 3 1;
#B color 4;
#P message 830 490 29 9109513 0 2 1;
#B color 4;
#P message 800 490 29 9109513 0 1 1;
#B color 4;
#P message 769 490 29 9109513 0 0 1;
#B color 4;
#P newex 149 579 40 9109513 noteout;
#P number 150 444 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 113 443 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 112 410 62 9109513 unpack 0 0 0;
#P user matrixctrl 112 270 131 130 MatrixDefaultCell.pct MatrixDefaultBkgnd.pct 131 130 16 16 8 8 16 16 1 1 49 2 5120 0;
#P window setfont "Sans Serif" 12.;
#P comment 506 570 100 9109516 MIDIOUT;
#P window setfont "Sans Serif" 9.;
#P window linecount 3;
#P comment 394 502 100 9109513 Unpack and translate Grid data to Midi for Ohm64 controller;
#P window setfont "Sans Serif" 14.;
#P window linecount 1;
#P comment 807 295 100 9109518 PLAYER 1;
#P connect 18 0 3 0;
#P connect 3 0 4 0;
#P connect 4 0 5 0;
#P connect 6 0 93 0;
#P connect 96 0 94 0;
#P connect 93 0 94 0;
#P connect 6 0 7 0;
#P connect 4 1 6 0;
#P connect 38 0 7 1;
#P connect 39 0 7 1;
#P connect 37 0 40 0;
#P connect 40 0 38 0;
#P connect 4 2 36 0;
#P connect 36 0 37 0;
#P connect 37 1 41 0;
#P connect 41 0 39 0;
#P connect 95 0 82 0;
#P connect 82 0 86 0;
#P connect 86 0 96 0;
#P connect 82 0 85 0;
#P hidden connect 85 0 89 0;
#P hidden fasten 89 0 88 0 297 471 342 471;
#P hidden connect 88 0 83 0;
#P hidden fasten 86 0 84 0 267 527 353 527;
#P hidden connect 83 0 84 0;
#P hidden connect 85 1 88 1;
#P connect 85 1 97 0;
#P hidden fasten 84 0 87 0 353 552 385 552;
#P hidden connect 87 0 91 0;
#P hidden connect 92 0 91 0;
#P hidden connect 85 2 90 0;
#P hidden connect 90 0 87 2;
#P connect 74 0 69 0;
#P connect 69 0 70 0;
#P connect 70 0 71 0;
#P connect 70 1 72 0;
#P connect 72 0 81 0;
#P connect 81 0 73 0;
#P connect 78 0 73 1;
#P connect 77 0 73 1;
#P connect 76 0 79 0;
#P connect 79 0 77 0;
#P connect 70 2 75 0;
#P connect 75 0 76 0;
#P connect 76 1 80 0;
#P connect 80 0 78 0;
#P connect 19 0 20 0;
#P lcolor 5;
#P connect 21 0 22 0;
#P connect 29 0 23 0;
#P connect 31 0 24 0;
#P connect 30 0 24 0;
#P connect 17 0 24 0;
#P connect 31 0 25 0;
#P connect 19 0 25 0;
#P connect 17 0 25 0;
#P connect 21 0 26 0;
#P connect 19 0 26 0;
#P connect 17 0 26 0;
#P connect 29 0 27 0;
#P connect 19 0 27 0;
#P connect 17 0 27 0;
#P connect 30 0 28 0;
#P connect 19 0 28 0;
#P connect 17 0 28 0;
#P connect 17 0 8 0;
#P lcolor 1;
#P connect 32 0 34 0;
#P connect 34 0 35 0;
#P connect 35 0 33 0;
#P connect 33 0 17 0;
#P connect 19 0 9 0;
#P lcolor 5;
#P connect 17 0 9 0;
#P lcolor 1;
#P connect 33 1 19 0;
#P connect 21 0 10 0;
#P connect 19 0 10 0;
#P lcolor 5;
#P connect 17 0 10 0;
#P lcolor 1;
#P connect 33 2 21 0;
#P connect 8 0 16 0;
#P connect 9 0 16 0;
#P connect 10 0 16 0;
#P connect 11 0 16 0;
#P connect 12 0 16 0;
#P connect 13 0 16 0;
#P connect 14 0 16 0;
#P connect 15 0 16 0;
#P connect 20 0 16 0;
#P connect 22 0 16 0;
#P connect 23 0 16 0;
#P connect 24 0 16 0;
#P connect 25 0 16 0;
#P connect 26 0 16 0;
#P connect 28 0 16 0;
#P connect 27 0 16 0;
#P connect 33 3 29 0;
#P connect 29 0 11 0;
#P connect 21 0 11 0;
#P connect 19 0 11 0;
#P lcolor 5;
#P connect 33 4 30 0;
#P connect 33 5 31 0;
#P connect 30 0 12 0;
#P connect 29 0 12 0;
#P connect 21 0 12 0;
#P connect 31 0 13 0;
#P connect 30 0 13 0;
#P connect 29 0 13 0;
#P connect 31 0 14 0;
#P connect 30 0 14 0;
#P connect 31 0 15 0;
#P connect 52 0 53 0;
#P lcolor 5;
#P connect 54 0 55 0;
#P connect 62 0 56 0;
#P connect 64 0 57 0;
#P connect 63 0 57 0;
#P connect 51 0 57 0;
#P connect 64 0 58 0;
#P connect 52 0 58 0;
#P connect 51 0 58 0;
#P connect 54 0 59 0;
#P connect 52 0 59 0;
#P connect 51 0 59 0;
#P connect 62 0 60 0;
#P connect 52 0 60 0;
#P connect 51 0 60 0;
#P connect 63 0 61 0;
#P connect 52 0 61 0;
#P connect 51 0 61 0;
#P connect 65 0 67 0;
#P connect 67 0 68 0;
#P connect 68 0 66 0;
#P connect 66 0 51 0;
#P connect 66 1 52 0;
#P connect 51 0 42 0;
#P lcolor 1;
#P connect 66 2 54 0;
#P connect 49 0 50 0;
#P connect 48 0 50 0;
#P connect 47 0 50 0;
#P connect 42 0 50 0;
#P connect 43 0 50 0;
#P connect 44 0 50 0;
#P connect 46 0 50 0;
#P connect 53 0 50 0;
#P connect 55 0 50 0;
#P connect 56 0 50 0;
#P connect 57 0 50 0;
#P connect 58 0 50 0;
#P connect 59 0 50 0;
#P connect 61 0 50 0;
#P connect 60 0 50 0;
#P connect 45 0 50 0;
#P connect 66 3 62 0;
#P connect 52 0 43 0;
#P lcolor 5;
#P connect 51 0 43 0;
#P lcolor 1;
#P connect 66 4 63 0;
#P connect 66 5 64 0;
#P connect 54 0 44 0;
#P connect 52 0 44 0;
#P lcolor 5;
#P connect 51 0 44 0;
#P lcolor 1;
#P connect 62 0 45 0;
#P connect 54 0 45 0;
#P connect 52 0 45 0;
#P lcolor 5;
#P connect 63 0 46 0;
#P connect 62 0 46 0;
#P connect 54 0 46 0;
#P connect 64 0 47 0;
#P connect 63 0 47 0;
#P connect 62 0 47 0;
#P connect 64 0 48 0;
#P connect 63 0 48 0;
#P connect 64 0 49 0;
#P pop;

Hors ligne

 

#8 2010-12-22 01:04:15 Re : Simuler un pong avec l'objet Matrixctrl.

pschiiitt
membre
Date d'inscription: 2009-03-21
Messages: 318

Re: Simuler un pong avec l'objet Matrixctrl.



Salut,

Tu pourrais alors l'écrire ainsi pour gagner un peu de calcul :
http://codelab.fr/up/Image-1-6.png
Ou plus simplement, rendre aléatoire la trajectoire à chaque contact :
http://codelab.fr/up/Image-2-1.png

Mais, je ne comprends pas très bien la finalité de ce programme : est-ce seulement un jeu ?
Si c'est le cas. Il aurait été graphiquement plus fidèle à l'original grâce à l'objet lcd, par exemple.

P.-S. : Pour la collision, il faut détecter la raquette en posant des conditions comme dans mon exemple avec la détection des bords. C'est le même principe.

Dernière modification par pschiiitt (2010-12-22 01:07:23)

Hors ligne

 

#9 2010-12-22 02:22:10 Re : Simuler un pong avec l'objet Matrixctrl.

tobald
modérateur
Date d'inscription: 2008-03-28
Messages: 499

Re: Simuler un pong avec l'objet Matrixctrl.



La finalité c'est de créer un pong pour un gridcontroller (un détournement en quelque sorte) d'ou l'utilisation de la matrixctrl (c'est peut être faisable avec lcd tu me diras)Après mon niveau max étant vraiment médiocre, je me suis dit que c'était un bon "défi" à relever.

http://farm5.static.flickr.com/4117/4908299100_1a37c41d62.jpg

(En utilisant les faders pour controller la raquette)

Comme j'expliquais précédemment , j'utilise 3 matrices et les "raquettes" prennent trois points sur la grille. C'est difficile à expliquer mais la façon dont j'ai codé ces "raquettes" fait que les conditions de collisions sont un peu plus compliqués à rendre qu'avec un simple [if]

Encore merci pour tes conseils.

Hors ligne

 

#10 2010-12-27 15:36:33 Re : Simuler un pong avec l'objet Matrixctrl.

pschiiitt
membre
Date d'inscription: 2009-03-21
Messages: 318

Re: Simuler un pong avec l'objet Matrixctrl.



C'est plus clair.

Donc, tu n'as pas besoin d'un [ctrlmatrix] qui est un doublon d'interface avec ton appareil.
Il te faut juste un [coll] qui te donne une table de correspondances des messages à envoyer à ton matériel.

Pour moi, le principe est le même : comparaison de valeurs.
Par contre, tu dois recevoir la position de ta raquette de ton interface.

Une autre voie avec un [split] (c'est un objet qui contient l'instruction if) me paraît plus compliqué.

Dernière modification par pschiiitt (2010-12-27 15:54:10)

Hors ligne

 

fil rss de cette discussion : rss

Pied de page des forums

Powered by FluxBB

codelab, graphisme & code : emoc / 2008-2024