So anyway, since collision detection is a main subject on Alice, I thought it would be a good idea to start a miny project involving creating engines/demos that showcase collision detection and other physics-related events.
Anyways, I made this Alice world that is able to detect hills and allow objects to move smoothly over them.
Anyways, fyi, I used zonedabone's collision detection engine, figuring it had a lot of things on it that I wouldn't need to recreate, like the object arrays, some variables, the maintenance script, etc. So zonedabone: thanks a lot! Also, I added to documentation (aka comments), including the parts that zonedabone coded, so hopefully people can understand it a little better.
Anyways, feel free to use the code, or implement the world into your own game, as long as you give me credit
I am open to suggestions and I already have a "to-do" list that can be seen in the documentation in the world. I'll be editing this original post to add any updates or new versions.
PS Zonedabone: Feel free to "upgrade" the program in any way with your awesomeness (there are some other maintenance issues).
EDIT: Just realized this is my 100th post! Woot! XD
EDIT2: Ok, just added the world! Feel free to look! Don't mind the file name, I couldn't think of a good name. lol Btw, if you want the hills to look realistic, you can just change the sphere's texture to the ground's. Also, you can add more hills simply by adding more spheres (that are sunken into the ground) into the hill array.
Notes
-As of right now, only hills in the shape of perfect semi-spheres work. I am working on "shallow hill.s"
-The ball is going down via a loop that moves the ball down. You can try to tweak the length and time parameters so get a smoother effect. On one extreme, it will appear as if the ball is vibrating and on the other extreme, the ball might just "fall" off the semi-sphere. You can interpret that as a bug, or gravity, whatever you wish. =D
To-Do List
-Shallow hills (not just semi-spheres)
-Calculating slope of hill to allow things to rotate accordingly (such as a car driving on it. You wouldn't want the car to be parallel to the ground the whole time.)
-Implementing offset variable since some objects have a "center" that touches the ground
-Allow main object to move correctly at hill intersections (like if we put the two hills together such that parts of the hill are within each other. Would make for good "rolling hills" effect.)
-Change main object to an array of main object's'
-Let me know!