-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Portals #9
Conversation
Tested it out - code looks great and I get sensible notifications when activating the blocks, but for some reason I'm not actually triggering the teleport. Clearly you had it working at some point - am wondering if my workspace is bad or maybe the final bit of optimizing broke something? Maybe there was some stale code letting it still work using a less optimized approach? In any case I'm sure that's easy to sort out. Let me know if you can confirm the latest working for you (try a rebuild if it does appear to work) and if so I'll have to see what's wrong on my side :-) |
Yep, sorry, my mistake. I missed out a line which was required for the added optimization to work. I think I had it working on a debug mode when |
Tests out! Yay! :D Thanks for the cool new functionality :-) |
This adds portal blocks, which allow you to teleport from A to B.
There are two types of Portal blocks- blue and orange.
Activating Portals
Since there can exist many portal blocks in the world, a portal block needs to be activated to allow teleportation. To activate a portal block, it has to be interacted with by 'e' click. Activating a portal block, would deactivate previously activated portal block of the same color, i.e. no two portal blocks of same color can remain activated at once, so as to allow a discrete teleportation pathway.
Travelling through Portals
Once both the blue and orange portals are activated, you can travel/teleport thorugh them by jumping on top of the portal blocks. The portals are two-way, i.e. jumping through A will take you out of B and vice-versa.
Testing
give bluePortalBlock
give orangePoralBlock
Outstanding
Added a check to see if blocks around are free up till playerHeight
Added an additional check inside to continue only if playerPosition has changed,