PDA

View Full Version : Making an object rotate with a platform & slopes too...



DrRobot
December 7th, 2007, 06:14 PM
Alright, so i've been having this idea lately, i'm planning on making a platform engine, and i though it'd be cool to have platforms with their own gravity and such, where you rotate as it rotates and all.

and another little idea is that when i walk around on a certain platform, i'd rotate as the floor is sloped.

I haven't messed with the code yet, though i have some sort of idea...

Anyway, do you have an idea of what i should do to do this, or maybe flash some samples my way?

ArmoredSandwich
December 7th, 2007, 06:24 PM
Alright, so i've been having this idea lately, i'm planning on making a platform engine, and i though it'd be cool to have platforms with their own gravity and such, where you rotate as it rotates and all.

and another little idea is that when i walk around on a certain platform, i'd rotate as the floor is sloped.

I haven't messed with the code yet, though i have some sort of idea...

Anyway, do you have an idea of what i should do to do this, or maybe flash some samples my way?

well for one it sounds really cool. I dont really have any experience with platform stuff at all. I mean i have an idea on how i would start, but i bet you have too.

Just saying, go for it, sounds awesome xD

DrRobot
December 8th, 2007, 01:12 PM
yea, thought it'd be a great idea. but doing it is the problem. lol

Sauceofallevils
December 8th, 2007, 11:14 PM
You should take a look at Strille's platform engine, he made it easy to make platforms have different characteristics, I'm sure you can learn a lot from it.

Engine Test:
http://www.strille.net/works/misc/platform_demo/

Tutorial
http://www.strille.net/tutorials/part1_scrolling.php

I hope this helps you, good luck!

DrRobot
December 9th, 2007, 12:03 AM
that's not exactly what i was looking for...

DangerousDan
December 10th, 2007, 08:46 AM
I think you should be able to do some trig and figure out the angle you need to be rotated.



rotation = Math.TanInverse(slope._y/slope._x);


Something like that, I'm not very good at math though and I was too lazy to look up the correct code for the Inverse of Tan.