forums

TNT Basic Forums > Programming Q&A
RPG Games
< Last Thread     Next Thread >
Author
Thread        Post A Reply

03-14-2011 16:19

Posted by:
Connors

Location:
Albuquerque

Find more posts by Connors

Once again I return to this forum, hoping it still isn't completely dead. I made this in hopes of putting together and RPG once again taking advantage of TNT's map features. The problem is it won't load a map a third time. If you go the west map and back it keeps the west map and puts you on the left side. And vice versa if you start on that map and go east! I tried putting "unload map area" before "load map room" but it had a glitch.

Window mode 800, 600
set framerate 30
load images 128

string state = "explore"
int west = 2
int east = 1
global int area = 1
global int loaded = false
int grid = 32
int start
global int tilex = 13
global int tiley = 6
int n
int wait
int playersprite = 1


repeat

while state = "explore"

if start = 0
loadroom(1)
start = 1
end if

if wait < 0
if pressed (123)
if tilex = 0
LoadRoom(west)
tilex = 18
else
if map tile (tilex-1, tiley, 0) = 1 then tilex = tilex - 1
end if
wait = 3
end if
if pressed (124)
if tilex = 18
LoadRoom(east)
tilex = 0
else
if map tile (tilex+1, tiley, 0) = 1 then tilex = tilex + 1
end if
wait = 3
end if
if pressed (125)
if map tile (tilex, tiley+1, 0) = 1
tiley = tiley + 1
end if
wait = 3
end if
if pressed (126)
if map tile (tilex, tiley-1, 0) = 1
tiley = tiley - 1
end if
wait = 3
end if
end if

wait = wait-1

sprite 1, (tilex * grid)+10, (tiley * grid)+5, playersprite

draw frame

wend

until state = "quit"



procedure LoadRoom(int room)

load map room
area = room
open map viewport 1,0, 10,10 to 618, 522

end proc

03-16-2011 18:20

Posted by:
Connors

Location:
Albuquerque

Find more posts by Connors

Formatting

OK so spacing didn't show up, this is a little bit hard to read. I guess I will try to avoid that next time.

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.