Storyline 360 added a number of new object events that can be used to check when an object:
- intersects with another object (or objects)
- doesn’t intersect with an object any longer
- enters a slide, or
- leaves a slide.
The most obvious application for these events would be ‘collision detection’. I thought that creating a simple game, like the good old Pong (a game that was first introduced in the 70s) would be a good test case to try out these events.
The idea seemed simple: move an object along randomly selected motion paths at different angles and duration until it hits one of two movable ‘paddles’, intersects with the bottom or top wall, or leaves the slide on either side.
Also, my first idea was to use sliders for the paddles. It turns out that sliders, although they can be selected as an intersecting object, do not generate ‘hits’. So, I had to use transparent objects that are turned on/off depending on the position of the paddle sliders. Whenever the pong object hits one of the paddles a sound is played and the current motion path is reversed. If neither paddle is hit, the pong object will continue on the selected motion path and eventually leave the slide on either side. When the object leaves the slide:
- a sound is played
- a score is calculated (depending on which side of the slide the object existed)
- a new motion path is drawn and the interaction is repeated until one of the players has reached 10 points.
In Preview this works flawlessly. However, I did notice that in the published version, both HTML5 and Flash, the interaction randomly locks up. But that’s the point of an experiment; sometimes it just doesn’t work out as expected and that’s okay. I did learn enough about the Storyline mechanics of a pong-like game, so that I could expand on the prototype anytime and create a full-featured game interaction.
Edit 04/2017: It seems that changing the browser and player settings to lock the interaction at its optimal size improves the stability of the published content. Here is a version with edited player settings.