Wednesday, January 26, 2022

à l'eau ?

J'imagine que ça devait être la prochaine chose à faire: s'assurer que Bilou sache rentrer dans l'eau et que les mouvements quand il s'y trouve soient différents de ceux dans l'air. C'est encore assez primitif, mais ça commence à marcher.

Let's dive in: the last demo was nice, but it sure felt awkward to have the water behave as a solid platform. I suppose it's a mandatory to-do item before I release something new: make sure the water feels more like water. It will be perfectible, of course. I don't intend to make it look more like water at this iteration, but at least ensure that I can detect when Bilou is entering water and make him act differently. And that is slowly getting in shape... 

J'ai finalement pris l'approche envisagée dans mes notes de l'an dernier (ou 2 ans ?): une bande de tiles haute comme Bilou qui autorise à la fois de tomber et de nager. La surface est dessinée à peu près à mi-hauteur de cette bande.

Du coup, quand Bilou rencontre enfin de "l'eau profonde" dans laquelle il n'est plus possible de tomber, il est déjà capable de nager là où il se trouve.

ça ne fonctionnerait pas aussi facilement avec un personnage plus gros comme ce poisson, mais on y est pas encore, au gros poisson (je n'en ai même pas dans mes cartons pour 'Dreamland', alors ...)

trivia: the animated gif above is about 100KB. The one I initially captured was over 1.5MB due to scrolling. I had to create a 'dontmove.cmd' object and give it the focus so I could capture the proper sequence. If you look carefully above the water surface, you can spot it.

There's one thing I'd like to get fixed soon: when you reach back the surface, you're stopped straight. That should not happen, but I do not seem to be able to fix it with a transition. This is a job for a revived "muad-debugging" session: it would let me see step by step why no transition is taken by re-playing the think() function after I detected yspeed == 0.

edit: I'll have to write a dedicated 'in-water' controller: hacking with 'increase' and 'freemove' doesn't produce anything convincing even after freemove is fixed so that it fails at the surface.