My students are obsessed with making parkour games. The built in navigation makes it easy to run. The kids build the platform and then they can jump from one to another with the arrow keys. However- they want this to happen… when a player falls from or misses any platform they want the use to return to the starting point of their parkour course. How would they code this with the coblocks? Is it the camera that gets coded?
To reset the position of a camera when it falls down you can do the following:
- Create a ‘resetZone’ - cube which defines where the reset should happen
- Add the camera item and the resetZone cube to CoBlocks
Then, in CoBlocks:
- Save the starting position of the camera to a variable
- Use a “when collision” - block to check when the camera collides with the resetZone cube
- When the collision happens, place the camera back to the starting position
Below you can find an example space you can remix to see how it’s done in CoBlocks
Hope this helped!
Touching the ground (stage)
Thank you so much!! You’ve made a lot of 5th graders very happy!
Are any of your Parkour games in the gallery? I’d love to see what you/they have come up with. Sounds fun!! Are you using physics?
They aren’t in the gallery yet. Their log in accounts are attached to their school gmail account and it has their full name. I can’t post it with their name attached.
I wonder if you were to copy their work to your spaces if it would delete their name or allow you to do so?
I forgot about this. Thank you!
I shared it but then had to take it down. The kids had written their full names on a wall in their course. Ha ha! They’re going to edit it and I share it again. They are very excited to share with the world!
I’m not able to get the camera to collide with different objects. For example, I have the camera return to location using the method you described (When Collide), but I cannot add another When Collide for the camera to collide with different object (to go to another location, for instance). When I try, the first When Collide stops working.
Please take a look at another thread to see how event handlers work in CoSpaces. The most important there is that only one collision handler of a particular type can be active at the same time on a given item. You can find a workaround for this in the thread linked above as well (one of them is using single “when collide” block with “if-else” statement inside).