Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Question on room changing  (Read 1366 times)

0 Members and 1 Guest are viewing this topic.
Question on room changing
« on: January 16, 2012, 08:32:24 pm »
  • *
  • Reputation: +2/-0
  • Offline Offline
  • Gender: Male
  • Posts: 269
hello, i have been in the process of putting together a link to the past styled engine, and it has progressed to a point where a single test room just doesnt put this engine to the full potential this coding could be used for, and i want to test out alot of the features in between levels. so i have started to think up a zelda changing room sequence. and as of now the only thing i have come up with this under links outside room event
"
if Link.x < 0
{
global.mapx -= 1
}

if Link.y < 0
{
global.mapy -= 1
}

if Link.x < 640
{
global.mapx += 1
}

if Link.y < 480
{
global.mapy += 1
}
""
as a sort of check to see where he is. and if he leaves the global.mapx and global.mapy would be changed accordingly. now im stuck on a way to put that into changing rooms. such as having my rooms all have numbers(like rm_5_5) and such. does anyone have any idea what to place as the code to calculate the global.mapx and y into what the room numbers =, and then changing the rooms accordingly? thanks for anyone that gives help.
Logged
Re: Question on room changing
« Reply #1 on: January 16, 2012, 09:16:42 pm »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
A simple suggestion: Use teleportation objects.

Example: You create an object called tel_object1.  If Link touches tel_object1, then goto whatever room would correspond with that object.  Now you could create a few more that transition to different rooms wherever you need it.

Then, so you don't have a million teleport objects, you run a check based on the current room you are in.
So if could look something like:
Link COLLISION tel_object[insert number]
if room == room2
{
goto room 5;
}
else if room == room7
{
goto room4;
}

That's psuedo code.  You could also change that into a switch case.

Logged
  • Super Fan Gamers!
Re: Question on room changing
« Reply #2 on: January 16, 2012, 09:31:07 pm »
  • *
  • Reputation: +2/-0
  • Offline Offline
  • Gender: Male
  • Posts: 269
I was going to make 4 different objects with different creation codes and such, sort of what you just explained. but i wanted to have it in code, where i could add any room, assign it a number, and be done. not go through tons of rooms and place objects surrounding the map, each with creation codes or seperate codes which in itself would be a great chance for bugs to appear.
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.06 seconds with 44 queries.