Staircase Movement

You must understand the Game Editor concepts, before post here.

Staircase Movement

Postby DrakeStoel » Tue Jun 21, 2016 5:31 am

Hi!

I've been adding "floors" to my game's dungeons, but haven't been able to find a simplistic way of moving my player from staircase to staircase. What I do now is make two separate filled regions that, on collision, take my player off to the other one. And I have a new pair for every single staircase called things like D1S1 (Dungeon 1, Stairs 1) is paired with D1S2 (Dungeon 1, Stairs 2), etc. Not only does this make my list of actors huge, but it also gets real confusing real fast.

So my question is: Is there an easier way to move an actor between two locations with perhaps clones so as to not use a lot of actors? I suppose in a manner similar to lcl's Doors Tutorial (which I have tried to edit to work on collision, but was unsuccessful)?

Thanks in advance!
DrakeStoel
 
Posts: 43
Joined: Wed Oct 03, 2012 8:53 am
Score: 2 Give a positive score

Re: Staircase Movement

Postby schnellboot » Tue Jun 21, 2016 8:23 pm

check global code -> doors
should be self explanatory
if you dont understand feel free to ask
Attachments
doors.zip
(5.74 KiB) Downloaded 149 times
schnellboot
 
Posts: 819
Joined: Sat Mar 31, 2007 1:35 pm
Location: Germany
Score: 102 Give a positive score

Re: Staircase Movement

Postby DrakeStoel » Wed Jun 22, 2016 11:40 pm

Hey, thanks for the response!

I tried it out, but for some reason the first time I collide with the door actor (I have it set up as a filled region, instead of a regular actor, not sure if that makes a difference) it sends my actor off into nowhere, which I can correct by moving my player some thousands of pixels around the next one of the pairs. After that first warp however, the function works fine. I'm curious as to why this is.

Thanks!
DrakeStoel
 
Posts: 43
Joined: Wed Oct 03, 2012 8:53 am
Score: 2 Give a positive score

Re: Staircase Movement

Postby lcl » Fri Jun 24, 2016 11:16 am

Hello DrakeStoel!

DrakeStoel wrote:I tried it out, but for some reason the first time I collide with the door actor (I have it set up as a filled region, instead of a regular actor, not sure if that makes a difference) it sends my actor off into nowhere, which I can correct by moving my player some thousands of pixels around the next one of the pairs. After that first warp however, the function works fine. I'm curious as to why this is.


It's pretty difficult to say what's causing the problem without seeing how you've actually implemented schnellboot's code.
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: Staircase Movement

Postby DrakeStoel » Sat Jun 25, 2016 3:00 am

Sure, sure!

I've actually figured it out now. I did just copy and paste the code from the demo into my game, but the problem was that the codes were battling with some of my other codes and it just messed up the destination... For some reason. Not sure why, but I worked it out and now it works great! Thanks so much guys!
DrakeStoel
 
Posts: 43
Joined: Wed Oct 03, 2012 8:53 am
Score: 2 Give a positive score

Re: Staircase Movement

Postby Zivouhr » Thu Nov 03, 2016 8:10 pm

Good to hear it's working and good point that the other interconnected/dependent codes can affect the results when any big change is made.
City of Rott Game created on Game Editor http://cityofrott.wordpress.com/
User avatar
Zivouhr
 
Posts: 549
Joined: Sat May 17, 2014 2:12 pm
Score: 59 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest

cron