Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / how do I save x and y positions for tilemaps! (I Know how to save images)

Author
Message
Computer Nerd
20
Years of Service
User Offline
Joined: 25th Jan 2005
Location: What do you care?
Posted: 18th Jan 2006 15:32
How do I do that save x and y positions. Like if I paste a sprite how do I get it's x and y position and then save it and reload it again to put him on screen. I know how to do the rest!

If you need a 2d game maker that's free and open source then go to:
http://gamedeveloper1.tripod.com/.
Paisleys finest
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: In a house
Posted: 18th Jan 2006 16:44
Why paste a sprite and have to record it's x and y coords when you could just as well use the SPRITE function, which remembers them for you.

SPRITE spritenumber, x,y, imagenumber

Then every time you Sync the sprite will reappear in the same place.

Scott Tunstall
Author of the UNIFIED ZOMBIE MOD (www.unifiedzombiemod.wz.cz)
Current work in progress: Retro Remake of BRUCE LEE, by Datasoft (1984)
Paisleys finest
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: In a house
Posted: 18th Jan 2006 16:45
I must warn you though - using the SPRITE method causes a dramatic drop in FPS. I don't know why that is

Scott Tunstall
Author of the UNIFIED ZOMBIE MOD (www.unifiedzombiemod.wz.cz)
Current work in progress: Retro Remake of BRUCE LEE, by Datasoft (1984)
Computer Nerd
20
Years of Service
User Offline
Joined: 25th Jan 2005
Location: What do you care?
Posted: 18th Jan 2006 20:17
I didn't explain that right did I. I want to save a tilemap whilst remembering all my sprites x and y positions. I know using sprites are better then pasting images for some jobs I'm not *sigh* a noob.

Everyone's a noob at one time but some people are noob's forever they are called: spammers.
Game Developer will be out when pigs can fly and before you take that the wrong way look at my avatar.
Computer Nerd
20
Years of Service
User Offline
Joined: 25th Jan 2005
Location: What do you care?
Posted: 18th Jan 2006 20:18
I might know how to do it so what the hell don't reply.

Everyone's a noob at one time but some people are noob's forever they are called: spammers.
Game Developer will be out when pigs can fly and before you take that the wrong way look at my avatar.
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 18th Jan 2006 23:12 Edited at: 18th Jan 2006 23:13
There's no need to save the x and y positions of all the pasted images because when you make a tile map the map can be much bigger than the screen.

The important information is the x and y of the upper left of the map which can be saved with 2 variables. Anytime you want to detect what the character can move through you use the x and y of the map not the screen itself.

In this code snip the only actual screen coordinates are the starting x and y (which are both zero):



Attachments

Login to view attachments
Computer Nerd
20
Years of Service
User Offline
Joined: 25th Jan 2005
Location: What do you care?
Posted: 18th Jan 2006 23:41 Edited at: 18th Jan 2006 23:43
Thank you Grog for taking time to help me out I think it's a better way then when I was doing it.

Yeah your code's more advanced then mine lol.

Everyone's a noob at one time but some people are noob's forever they are called: spammers.
Game Developer will be out when pigs can fly and before you take that the wrong way look at my avatar.
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 19th Jan 2006 08:56
Quote: "Thank you Grog for taking time to help me out I think it's a better way then when I was doing it. "


Np.

Quote: "Yeah your code's more advanced then mine lol."


We've all been there so don't sweat it. And there's always room for improvement. I just noticed I left "dim Tex$(12)" in there.


Login to post a reply

Server time is: 2025-05-16 09:08:47
Your offset time is: 2025-05-16 09:08:47