Secretchronicles / TSC

An open source two-dimensional platform game.
https://secretchronicles.org/
GNU General Public License v3.0
205 stars 49 forks source link

x.start_direction = y does only change movement direction, not images #287

Closed ghost closed 9 years ago

ghost commented 9 years ago

I had the scenario that I spawned a bunch of furballs and set their start_direction to :left. That caused them to moonwalk.

Can someone confirm this?

DarkAceZ commented 9 years ago

Are you talking scripting? On quite a few occasions, I've noticed that my enemies (and sometimes Quintus') were walking backwards until they hit a wall. I just assume you could fix it by modifying the script a bit more...

ghost commented 9 years ago

Yes, I'm talking about the scripting API.

I just assume you could fix it by modifying the script a bit more...

If you mean, by set_direction: Why are there even two possibilities to change directions?

DarkAceZ commented 9 years ago

I'm not too sure on it, but I think there might be some function you're supposed to call after changing the direction manually via scripting... Maybe that was just in raw C++. Quintus would be the one to ask for sure, but you could do some digging on the docs: http://docs.secretchronicles.de/api/devel/classTSC_1_1cMovingSprite.html

Maybe try Update_Rotation_Hor()?

ghost commented 9 years ago

Apparently there are actually two direction members in that class, maybe I'll try set_direction() later. Hate to say, but the engine really is a mess.

Maybe try Update_Rotation_Hor()?

That apparently isn't exposed to mruby.

Also, what's with those m_ prefixes for the members?

@Quintus

Quintus would be the one to ask for sure...

Quintus commented 9 years ago

This is a bug in the scripting API. The method @sauer2 used should change the image also. Should be an easy one to fix.

Do we want a method #moonwalk in the API nevertheless? :-P just kidding...

Vale, Quintus