Limit on command Character.Walk ?

Started by , Wed 21/02/2007 17:30:23

Previous topic - Next topic

Jagged

I've used the undhandled_event function in a way to catch all non-useful clicks and make it work as though the player had been using the walking cursor there.

However, when I do this with a screen that can scroll down, the character doesn't seem to be able to walk further "south" than around y-coordinate 300.

Is it the Walk command that has an upper limit, or the mouse.y coordinate, or me that's dumb, or something else?

All best, and thanks for an amazing game generator.

Ashen

#1
The mouse coords are Screen coordinates - they have a maximum of 320x200/240 (or 400x300 in 800x600 res) - so that could be what you're noticing. The Walk command shouldn't have any limits (if you use the eAnywhere parameter, it's not even limited to the size of the room). If it IS this - which it sounds like -  use GetViewportX/Y to compensate, e.g. player.Walk(mouse.x+GetViewportX(), mouse.y+GetViewportY());.

If not, what exactly are you trying to do? If you post your code, maybe we can help.
I know what you're thinking ... Don't think that.

Jagged

Quote from: Ashen on Wed 21/02/2007 17:40:27
The mouse coords [...] have a maximum of [...] 400x300 in 800x600 res

Sounds like that's exactly the explanation. I will try your solution with GetViewport which sounds like a plausible solution to me.

Thanks for the fast and competent answer!

SMF spam blocked by CleanTalk