Archived

This topic is now archived and is closed to further replies.

Woody FX

Playin with my Man!!

Recommended Posts

I got my Iso-metric engine for my game goin and now i''m at the stage of puttin my man on the screen and movin that bad-boy about!! He is a commando Called Joe. Joe will move to where ever the player clicks the mouse cursor on the Map! The only other option is if the mouse cursor is over an enemy Joe will then shoot the enemy when the mouse button is clicked!! But the enemies have not been implemented yet so it''s not to important for now! Each object on the map takes up the whole of each tile! so i''ll be using coarse object placment!! Does anybody have an recommendations as to the best way to do this!! I.e. simplest as i''m new to this lark of game programming!! Thanks Brian

Share this post


Link to post
Share on other sites
No i''m just tryin to get the Man on to the screen and to move from tile to tile using the mouse... just any recommendations before i go down the wrong road about doin it!! Just checkin ouot various examples that others have used to to the same thing to see if i can fing something that suit!!

A bit lost as to what values i need to store for my man!! And what is the best way/method to store them!

Thanks Brian

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
What kind of a structure are you using to hold all of your tile information?

Share this post


Link to post
Share on other sites
Hi!

Store Joe's x/y coordinates, a flag if he's moving or not, and another pair of x/y for his destination!!

If you click on the map, update Joe's destination with the location of the click! Also, set his moving flag to TRUE if the destination is not his current location!

Continuously check to see if Joe's move flag is set, and if so make him head towards his destination! If he reaches it, set his move flag to FALSE!

More exact than that is going to require more information from you!

Question! Why do you use so many exclamation marks! They are only properly used when expressing excitement or great emotion!

Just wondering!!!!!

Chris

Florida, USA
RTS Engine in Development
http://www.knology.net/~heaven
Jesus is LORD!

Edited by - Heaven on February 19, 2002 6:05:41 PM

Share this post


Link to post
Share on other sites
you are talking about pathfinding, look up for A* (A Star) tutorials on how to do it,

basically you need to have an integer (or any type you like) array the same size of your tilemap, each element of the array will represent a tile, you must initialize all those to -1, then based on the tile clicked (Goal) and the tile "Joe" is standing over, you assign numbers to the array, the Goal tile gets 0, and all 8 tiles around it get 0+1 = 1, unless there is an object over that tile, then you iterate on each of the surrounding tiles, and give the surrounding tiles the value 1+1 = 2, and so on untill you have assigned a value to all the tiles.

then you check the value of the tile "Joe" is standing over has, say it has 8, you check all the surrounding tiles for that tile, and move joe to the tile that has a lower value than 8 (which will be 7), and repeat until joe is standing over 0.

IF Joe is sealed inside a room and you click outside that room, the tiles inside the room will not get a value, so they will keep the default value -1, so if you check the value of the tile joe is standing over, and find -1, sorry, he cant go were you wanted him to go.

Share this post


Link to post
Share on other sites
Hello!!!! I had a lot of coffee!!! so i use alot of !!! !

I understand pathfinding alright...

Wondering what i need to store for Joe... his coordinates and if he is on the move or not,his destination, also probably his health!

How many different frames might i need if he can walk in 8 different directions and also shoot in eight different directions!

16 or maybe 32 if my animation is to look pretty good!!

Storing my tile info in a map.txt file trying to get something very simple going at first!!

Share this post


Link to post
Share on other sites
here is a simple thingie I wrote way back (I mean wayyyyyyy back)...
http://www.geocities.com/roam_fire/DemoFiles/TwoLayerTile.zip

use left-mouse-button to move the dude,
right-mouse-button to change the visible area
and the arrow keys just to scroll around..

graphics is my own work, crap for short, its not optimized so don''t mention it to me.

oh, it was compiled with debug info and not full-screen.

you can find more demoes here:
http://www.geocities.com/roam_fire

cheers



(: I am what I am, more or less

Share this post


Link to post
Share on other sites
oops I forgot,

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


(: I am what I am, more or less

Share this post


Link to post
Share on other sites
Checked out your demo Roam....not to bad at all!

What do i need to do get my man to appear on the screen...i''ll worry about movin him later, baby steps and all of that!!

Looked at a demo and code of an isogame that is very close to what i''m tryin to do but could not figure out how he was puttin the character on the screen.
http://www.isohex.net/downloads/IsometricDemo.exe

Can anybody point me in the way to get my man up on the map.

thanks Brian

Share this post


Link to post
Share on other sites
quote:
Original post by phenomenongames
dude, whats with all the exclamation points?

He''s Irish

Share this post


Link to post
Share on other sites
I'm Irish!! Come-on thats better than french and alot better than English! :-p



Edited by - Woody FX on February 21, 2002 7:47:34 AM

Share this post


Link to post
Share on other sites
I''m using two coordinate sets, one for the "real" position, on screen,
and one the virtual position, on the map,
since my map is made from tiles each 60x20 and the tilemap is 50x50 then my virtual space is 3000x1000.
anyway, I''m keeping the palyer location on the map as the virtual coords. and the tile it is over, I don''t keep for each tile the player that is on it.

so my drawing is in two stages, the map (background) and the objects on the ground,
the player, trees, pillars etc. (objects for short)
the objects are sorted by X first then by Y (which makes the drawing, left to right, top to bottom).

thats basically it.

(: I am what I am, more or less

Share this post


Link to post
Share on other sites
when I see an exclamation mark I think "not".

So seeing all your exclamaiton marks confuses me.
eg "Hello!!!! I had a lot of coffee!!! so i use alot of !!! !"

when I read this I see "hello not not not not" - that can be shortened to hello

"I had a lot of coffee not not not" - shortened to I didnt have a lot of coffee

"so I use a lot of not not not not" - which doesnt make any sense.

Maybe I should cut back on the C++?
Sorry about the rant I just had to say it.

Share this post


Link to post
Share on other sites