Derniers sujets | » Numbers par Ver2guerre Dim 02 Avr 2023, 00:47
» Mort ? par godbod Dim 22 Aoû 2021, 12:23
» Network, essai 1 par godbod Dim 09 Juil 2017, 02:18
» GODBOD par godbod Sam 08 Juil 2017, 14:05
» mon humeur par Ver2guerre Sam 30 Juil 2016, 19:44
» [A voir] Programme de traduction original : WikiTranslate par AdRiWeB Lun 01 Fév 2016, 04:50
» Reprise ? par Emyl Jeu 14 Juin 2012, 21:17
» Euh, ah ? par Ver2guerre Dim 27 Mai 2012, 12:11
» Problème TI 89 Titanium non visible après mise à jour par abdoukid Mer 23 Mai 2012, 13:37
» Y'a quelqu'un ? par Ver2guerre Sam 21 Avr 2012, 23:10
|
Qui est en ligne ? | Il y a en tout 8 utilisateurs en ligne :: 0 Enregistré, 0 Invisible et 8 Invités :: 1 Moteur de recherche Aucun Le record du nombre d'utilisateurs en ligne est de 367 le Dim 18 Oct 2009, 00:16 |
| | Auteur | Message |
---|
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 : 7494 Date d'inscription : 15/09/2007
Profil TI: (TI-89Tita)^2+TI83Plus TO: 50 [2380 - 2%] {54} Spécialité: Autres
| Sujet: fluidité ? Dim 20 Avr 2008, 03:13 | |
| Je cherche un moyen de "fluidifier" le mouvement du personnage, c'est-à-dire avoir un passage entre la position 1 et la position 2 du perso. Démonstration en image : Position initiale :
| mmmmmmmmmmmmmmmmmmmmmmmmmmm
|
Puis, appui de la touche [->]. Position finale : mmmmmmmmmmmmmmmmmmmmmmmmmmm
|
|
Or, en ce moment, l'image passe directement de la position 1 à la position 2. Seulement, ça fait un peu "brutal" comme déplacement. N'y aurait-il pas un moyen de mettre quelques étapes intermédiaires (du genre : à cheval sur les 2 cases, ou même plus affiné avec 1/4 vers la nouvelle position, puis à cheval, puis 3/4 vers la nouvelle position), uniquement en TI-Basic, et bien sûr, sans faire trop ramer la calto ? Au besoin, le code de mon programme se trouve dans ce salon. Le code de déplacement du perso est dans le fichier wow().
Autre souci : je cherche à faire un scroll (ou, plus exactement, l'équivalent de la balise updown) en Basic pur. Ceci, juste pour pouvoir dire que mon programme est fait entièrement en Basic ^^ (Cf le topic "gene()"). |
| | | tama Admin
Nombre de messages : 12376 Age : 32 Localisation : DTC ? :triso: Humeur : =) items : o Personalized field : huh ? oO Réputation : 3 Points : 9405 Date d'inscription : 08/08/2007
Profil TI: 84+, 89 tita, 89 tita TO: infini :p Spécialité: C 68k
| Sujet: Re: fluidité ? Dim 20 Avr 2008, 13:52 | |
| hmmm...enfin un post dans la catégorie Projets, ça f'sait pas mal de temps Pour ton moyen de mouvement, tu pourrais peut-être utiliser une boucle for : - Code:
-
//a=position actuelle //b=position d'arrivée
For z,a,b,n //n nombre de déplacement par itération : diminue-le pour rendre le mouvement plus fluide //afficher sprite aux nouvelles positions //petite pause (facultative) //effacer sprite EndFor
après il faut que tu gères a et b (et éventuellement c et d, si tu veux 2 dimensions), selon le déplacement qui vient de se faire (vers le haut ? vers le bas ? vers la gauche ? vers la droite ?)
Le problème de scroll, on en avait déjà parlé, et je crains que ce soit impossible de faire un "vrai" scroll en basic, ou sinon il sera très lent... |
| | | tama Admin
Nombre de messages : 12376 Age : 32 Localisation : DTC ? :triso: Humeur : =) items : o Personalized field : huh ? oO Réputation : 3 Points : 9405 Date d'inscription : 08/08/2007
Profil TI: 84+, 89 tita, 89 tita TO: infini :p Spécialité: C 68k
| Sujet: Re: fluidité ? Dim 20 Avr 2008, 21:54 | |
| - Citation :
Scrolling
Rather than display each screen as it comes up, it will look better if the map can be scrolled. This is possible using a combination of StoPic and RplcPic. Use StoPic to store all but one row or column of the screen to a temporary picture. Then RplcPic that same picture, but one row or column over. Finally, use a For loop to overwrite the remaining row or column with tiles. Here's an example which scrolls left (row0 and col0 are variables used to track where you are in the map): :StoPic temp,0,0,8*height,8*(width-1) :RplcPic temp,0,8 :col0-1→col0 :For row,0,height-1 :RplcPic #("tile"&string(map[row0+row,col0])),8*row,0 :EndFor
An even more advanced technique is smooth scrolling. Here, the same idea applies, except you shift the screen one pixel over at a time. Also, since you can't draw to negative coordinates of the screen, you might have to apply some trickery when scrolling left or up, or just not use the entirety of the screen.
J'ai trouvé ça pour le scrolling, après va falloir comprendre et adapter |
| | | tama Admin
Nombre de messages : 12376 Age : 32 Localisation : DTC ? :triso: Humeur : =) items : o Personalized field : huh ? oO Réputation : 3 Points : 9405 Date d'inscription : 08/08/2007
Profil TI: 84+, 89 tita, 89 tita TO: infini :p Spécialité: C 68k
| Sujet: Re: fluidité ? Mar 29 Avr 2008, 00:26 | |
| En attendant, j'ai trouvé ça sur TI-Freakware : - Citation :
207c0000578c303c00622150001e59882150001e59882150001e59882150001e59882150001e91fc0000000e51c8ffdc4e75 00004e710000 : Shift screen DOWN (1pxl) 207c00004c00303c006220e8001e20e8001e20e8001e20e8001e20e8001ed1fc0000000a51c8ffe44e7500004e710000 : Shift screen UP 207c00004c00303c00632210e29120c12210e29120c12210e29120c12210e29120c12210e29120c1d1fc0000000a51c8ffda 4e7500004e710000 : Shift screen LEFT 207c000057aa303c00632210e391208159882210e391208159882210e391208159882210e391208159882210e39120815988 91fc0000000a51c8ffd04e7500004e710000": Shift screen RIGHT
(c'est des chaines Exec) Mais, plusieurs problèmes : 1.Je ne suis pas sûr que ça marche sur toutes les 68k 2.J'ai eu un bug en l'essayant (erreur de copie ?) |
| | | 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 : 7494 Date d'inscription : 15/09/2007
Profil TI: (TI-89Tita)^2+TI83Plus TO: 50 [2380 - 2%] {54} Spécialité: Autres
| Sujet: Re: fluidité ? Mar 29 Avr 2008, 20:21 | |
| Bon, je vais tout archivé, et essayé ça.
Sinon, le truc de la fluidité des mouvements, ça n'a pas l'air très rapide tout ça... Tant pis, je m'en passerai. |
| | | 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 : 7494 Date d'inscription : 15/09/2007
Profil TI: (TI-89Tita)^2+TI83Plus TO: 50 [2380 - 2%] {54} Spécialité: Autres
| Sujet: Re: fluidité ? Mar 29 Avr 2008, 20:50 | |
| - tama a écrit:
-
- Citation :
Scrolling
Rather than display each screen as it comes up, it will look better if the map can be scrolled. This is possible using a combination of StoPic and RplcPic. Use StoPic to store all but one row or column of the screen to a temporary picture. Then RplcPic that same picture, but one row or column over. Finally, use a For loop to overwrite the remaining row or column with tiles. Here's an example which scrolls left (row0 and col0 are variables used to track where you are in the map):
:StoPic temp,0,0,8*height,8*(width-1) :RplcPic temp,0,8 :col0-1→col0 :For row,0,height-1 :RplcPic #("tile"&string(map[row0+row,col0])),8*row,0 :EndFor
An even more advanced technique is smooth scrolling. Here, the same idea applies, except you shift the screen one pixel over at a time. Also, since you can't draw to negative coordinates of the screen, you might have to apply some trickery when scrolling left or up, or just not use the entirety of the screen.
J'ai trouvé ça pour le scrolling, après va falloir comprendre et adapter J'ai compris, mais c'est trop lent. |
| | | tama Admin
Nombre de messages : 12376 Age : 32 Localisation : DTC ? :triso: Humeur : =) items : o Personalized field : huh ? oO Réputation : 3 Points : 9405 Date d'inscription : 08/08/2007
Profil TI: 84+, 89 tita, 89 tita TO: infini :p Spécialité: C 68k
| Sujet: Re: fluidité ? Mar 29 Avr 2008, 21:21 | |
| oui, forcément... les chaines Exec, ça marche ? |
| | | 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 : 7494 Date d'inscription : 15/09/2007
Profil TI: (TI-89Tita)^2+TI83Plus TO: 50 [2380 - 2%] {54} Spécialité: Autres
| Sujet: Re: fluidité ? Mar 29 Avr 2008, 22:10 | |
| Non, les chaînes Exec ne marchent pas.
Mais bon. Vive le scroll in C by tama !!
Topic clos, sujet résolu. |
| | | Contenu sponsorisé
| Sujet: Re: fluidité ? | |
| |
| | | |
Page 1 sur 1 | |
| Permission de ce forum: | Vous ne pouvez pas répondre aux sujets dans ce forum
| |
| |
|
|