Forum Discussion

RickMaranta's avatar
RickMaranta
Community Member
2 months ago
Solved

Top-Down game mechanics in Storyline

I was fooling around with the new API and created a proof of concept for some mechanics of a top-down game. You can use the WASD keys to move the robot around. If you roll close to objects, I set a variable that allows a layer to open. Unfortunately, the built in Intersection triggers don't work when you move objects with API method, so you need it to do it through JavaScript. 

If you move the robot off screen to the right, it will go to the next screen in the correct position it left. Try going back higher up and see how it works. The current demo only allows you to go to slide (or room) 3 and back. 

I can get the coordinates of a character object and then since you know the slide size, you can trigger variables to get you to the next slide and back. I also built some logic in to prevent the robot from going too far up or too far down. 

On the last slide that you can get to through the menu, you will notice a demo of a platform concept. Move the oval using the keys and notice that we can simulate gravity like any game engine. I imagine if I implemented the same positional logic that we could create a simple platformer but haven't got there yet. 

Full disclosure: All assets are generated using ChatGPT 4.0 except for the ovals and the rectangles. 😉

Take a look here. https://360.articulate.com/review/content/6104372d-85cf-41cc-8f81-6f42e3a6c061/review

  • Thanks Phil! Yes, there is some easing there. I'll upload the source file when I get a chance. My buddy ChatGPT helped a bit 😉. I have some code for collision detection that I wanted to test out as well and also try some animation by cycling through some states. 

5 Replies

  • RickMaranta's avatar
    RickMaranta
    Community Member

    I did a little more work on the demo and shared on LinkedIn but for those of you here, you can see my latest version here: https://labratlearning.com/demos/sl_topdown/story.html

    I did a bit more with collisions on the last slide and also did more simplified keyboard commands using global functions.

    And if you want to download the source as well as a spreadsheet with all of my triggers, you can find it here on GitHub. https://github.com/maranr/slTopDown

    (Also, what's with the "Solved" thing on this forum. Not everything is a problem... 😏)

  • This is coming along great. I like your angled top-down more than the absolute top-down I was expecting.

    I'm glad I'm not the only one. I have a single level for a platformer prototype I've been working through, and it's been a challenge to figure out scope and things with this new API. Code spread across different triggers, as well as it seems different kinds of triggers interacts in interesting ways. Be sure to share your next iteration of this!

  • I built a side scrolling game before the api and used motion paths getting the speed right is a real pain, I think you need to decrease the starting easing a little, but it has opened my eyes to a few ideas.

  • Works nicely I didn't look at your code, but do you have easing on the move it feels like it.

     

     

    • RickMaranta's avatar
      RickMaranta
      Community Member

      Thanks Phil! Yes, there is some easing there. I'll upload the source file when I get a chance. My buddy ChatGPT helped a bit 😉. I have some code for collision detection that I wanted to test out as well and also try some animation by cycling through some states.