SOLVED: Scroll width Room co-ordinates... Walk to x and y problem.. Improving

Started by barefoot, Sun 20/03/2011 12:38:30

Previous topic - Next topic

barefoot

Hi


Are co-ordinates x y (such as walk to) based on part of the Room you actually see at the time or the whole Room?

Secondly... I'm trying to remember where chars hotspots are.. is it somewhere in their lower half?

I have main char being followed and have set if colliding,

Code: ags

if ((cskeleton1.x - cwizard.x <=8 && cskeleton1.x >= cwizard.x) || (cwizard.x - cskeleton1.x < 8 && cwizard.x > cskeleton1.x))


The attacking char (cskeleton1 is bigger then char being attacked (cwizard)


cheers

barefoot






I May Not Be Perfect but I Have A Big Heart ..

Dualnames

Quote from: barefoot on Sun 20/03/2011 12:38:30
Are co-ordinates x y (such as walk to) based on part of the Room you actually see at the time or the whole Room?

They are room coordinates, and not screen. (which means yes, the whole room)
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

barefoot

Cheers Dualnames

I did have a slight problem..

barefoot
I May Not Be Perfect but I Have A Big Heart ..

TomatoesInTheHead

Quote from: barefoot on Sun 20/03/2011 12:38:30
Secondly... I'm trying to remember where chars hotspots are.. is it somewhere in their lower half?

Bottom center pixel, I think.

Khris

Quote from: barefoot on Sun 20/03/2011 12:38:30Are co-ordinates x y (such as walk to) based on part of the Room you actually see at the time or the whole Room?

Just to be clear: for the code you're using it obviously doesn't matter; both characters use the same frame of reference, so it'll work either way.

X,Y coordinates oftentimes refer to the position of something within the room, but they also oftentimes refer to the position on the screen. It simply depends on the command you're using. mouse.x gives the mouse's x coordinate in screen coordinates; to translate it to room coordinates you'd have to add GetViewportX(). Usually, commands that relate to the mouse position use screen coordinates (e.g. Hotspot.GetAtScreenXY()).

barefoot

Thank you guys   :=


Update.. clerical error
Code: ags

     cskeleton1.FollowCharacter(cwizard, 2, 1);


I am doing a Jason and the Argonauts skeleton style scene. The skeletons rise up from a hole and attack the main player (wizard) and the player gets a damage point whenever they collide. When they collide the main char auto moves to +x -y which was ok but then i had to do if char leaves left, bottom ,top edges then do another auto move if they hit these edges...  Should char's damage get to 10 then the skeleton stops following whilst the main char goes and gets re-energised at x y and its starts again..

To all intents and purposes this works even though the main char sometimes (not often)  fails to be released from collision and fails to auto move.

I have set an attacking char's (skeleton) speed faster (15,15) than main char (5,5) (wizard) and set it's  follow to 2,100 and collided set to 8 (as upper post) yet the attacking char (skeleton) is not as quick as i would like it to be...  

Have you any tips regarding follow and collide that may be an improvement?

It would be great if we could add an action point to a graphic such as a character who may have a sword and have the sword as the action point...like in colliding...   food for thought...

cheers

barefoot




I May Not Be Perfect but I Have A Big Heart ..

SMF spam blocked by CleanTalk