Page 1 of 1

Click and Move Actor ... A beginning to Strategy games in GE

PostPosted: Sun Jun 13, 2004 11:47 am
by ingsan
Following this post : http://www.game-editor.com/forum/viewtopic.php?t=299 here is what I've come to : http://paking.prod.free.fr/ingsan/GE_TU ... _Actor.rar

I got to tell you that my ascii contains no negative numbers, so don't ânic whenever you don't see them :wink:
I hope you like it :mrgreen:
Regards,
Mrs Green

PostPosted: Sun Jun 13, 2004 12:32 pm
by jazz_e_bob
Excellent.

I hope you don't mind. I have simplified the code.... :wink:

http://www.maybanana.com/pantzboi/game_editor/Click%20and%20Move%20Actor%20Jazz.ged

Simple is good because I am not too smart. :wink:

PostPosted: Sun Jun 13, 2004 12:40 pm
by ingsan
Oh, I really don't mind :P and in fact, it works better than mine (I found some bugs after )but as simple as it seems to be, I don't understand this : xmouse - (view.width/2) and ymouse - (view.height/2)
Could you explain to me this logic ? :oops:

PostPosted: Sun Jun 13, 2004 1:10 pm
by ingsan
Hmm, I think I understood ...

Image

What was strange to me was the - (view.width/2) or - (view.height/2)thing. Please clear me, - (view.width/2) do stand for the New view.width of the filled actor ? If that is right, then I understood EVERYTHING :wink:

Thank you, you are releaving me :D

PostPosted: Sun Jun 13, 2004 9:55 pm
by jazz_e_bob
The "handle" for the filled actor is its top left corner.

When the filled actor is created it is placed in the top left corner of the view.

x = -(view.width/2);
y = -(view.height/2);

When the filled actor is clicked it sends the main actor to:

xmouse - (view.width/2)
ymouse - (view.height/2)

This is because xmouse and ymouse are "screen co-ordinates". They need to be converted to "game" co-ordinates.

Hope this helps. I often find the difference between handles, view co-ordinates and game co-ordinates a bit tricky.... :)

PostPosted: Mon Jun 14, 2004 8:31 am
by ingsan
Understood, my friend :wink: