Posts: 143
Threads: 35
Joined: Oct 2004
what is the best way to switch maps?
if map(guyx,guyy)=4 then goto map2
map2:
basically everything that was in map1 but with the commands switched to map2?
or what other way is the best like how do you chain?
Posts: 143
Threads: 35
Joined: Oct 2004
somthing tells me this is the wrong way and i cant find anything on the subject
Posts: 677
Threads: 57
Joined: Jan 2005
This is just a guess but i think you set the area you want it to swithc maps on, and you take note of the x, change the map, change the y co-ordinates to the other end of the screen and display it using the old x and the new y.
url=http://www.sloganizer.net/en/]
[/url]
Posts: 143
Threads: 35
Joined: Oct 2004
Posts: 133
Threads: 19
Joined: Jan 2005
Quote:is it wrong to use goto?
GOTO is a bad command unless you realy need to.
Programm in some kind of loop
ie:
Code:
intro
prepare game
while done = 0
load level
game ' may set done to 1
wend
outro
This is just a 30 second suggestion and will need some work, but basicaly thats it.
color=red]Look at you, Hacker. A pathetic creature of meat and bone, panting and sweating as you run through my corridors. How can you challenge a perfect, immortal machine?" - Shodan, AI at Citadel Station orbiting Earth[/color]
Posts: 143
Threads: 35
Joined: Oct 2004
i dont really get that. how can i amek it switch maps at a certain spot? should i use the chain command if so what is the chain command how would i use it?
Posts: 133
Threads: 19
Joined: Jan 2005
Make two subs.
One for loading a level into memory and one to reset all local level data.
You need to have just one single game loop that can handle different levels and that just calls to these two subs when needed.
If thats not clear, wait for someone with a richer english language
(I could explain if you understand german
)
color=red]Look at you, Hacker. A pathetic creature of meat and bone, panting and sweating as you run through my corridors. How can you challenge a perfect, immortal machine?" - Shodan, AI at Citadel Station orbiting Earth[/color]
Posts: 2,765
Threads: 138
Joined: Nov 2002
Heyo! I can speak english! =P
1.
GOTO is not a bad command it's that it is easily misused. If used correctly it is quite handy.
2.
Depends on how the maps are stored. If they are stored in bitmap like datastatments (or files) IE:
1,1,1,1,1
0,0,0,1,1
1,1,0,1,1
1,1,0,0,0
1,1,1,1,1
then you can use 1 sub actually (to load it that is)
Psuedo-code
(EDIT: you can also clear and load the other map vars too)
Code:
SUB loadmap (mapnum)
OPEN "map" + mapnum + ".dat"
load the map into an array [map(x,y)] <--- make sure shared
'nuff said.
you can then change x,y pos of the char then use another sub to put the map onto the screen
^-^[/code]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.