forums

TNT Basic Forums > Programming Q&A
Question about After the map tutorial
< Last Thread     Next Thread >
Author
Thread        Post A Reply

02-03-2010 22:39

Posted by:
Destro

Location:
LBC (langley British Columbia)

Find more posts by Destro

So, I set up my game based on the map tutorial. I'd like to change the map now from within the game, but I don't know how to control the map objects.

if pressed (9)
set current map 129
end if

If I do this the map objects from map 128 become the map objects of 129... people change into machinery that stays people coloured... so if my game was about the Philadelphia-experiment that would be great!
Alas it is not, and I'm confused how to get them to stay on their respective maps.

Any ideas?

02-03-2010 23:27

Posted by:
Destro

Location:
LBC (langley British Columbia)

Find more posts by Destro

fixed

So. Made the map objects section within the game loop a procedure, which runs during the game loop.
Then made the "for n=0 to objNum-1" statement BEFORE the game loop into a second procedure, which is called before the game loop and when switching maps.
Also had to make all the variables to do with objects into globals, except n of course.
Then when switching levels I have a "for n=0 to objNum-1" statement that just sets the sprite colour of n+2 to off.

...
MapObjectSetup()

draw frame
while not pressed (12)


if pressed (9)
for n=0 to objNum-1
set sprite colour off n+2
next
set current map 129
MapObjectSetup()
end if

PlaceMapObjects()
...

hope somebody finds this useful!

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.