Keeping an element within a maze

drag

(Denis Fortin) #1

I am making a small game for my grandson who is two years old. It will principally run on an iPad and he will be able to drag an object (his cat) through a simple maze. I would like the object/cat to stay on the paths and not glide right over the hedges… I saw a Topic with Drag element limited by container, it constrains the object inside a box but I would like the box to stop an object from entering it thus keeping the cat to the path. I wanted to use the physic engine to define the boundaries but it didn’t work.
Thanks for your help


(David Guillermo Escalante Trinidad) #2

A work around its using the "“Control gravity with device tilt” function, since the drag “control element position” bypass the walls physics, but moving the object using the device tilt does the job.

maze.hype.zip (13.0 KB)

Here is a working demo using that file (i replace the red cube for a ball), you can test it using any tablet:
https://dl.dropboxusercontent.com/u/67104790/web/ipad_maze/maze/maze.html

In order to be fun to use you may want to disable the device rotation.


(Denis Fortin) #3

Thank you vey much. I’ll try that. I don’t know if he’ll be able to manipulate the iPad to complete the maze but children are very adept using technology. :slight_smile: