The Daily Click ::. Forums ::. Klik Coding Help ::. The dreaded platform swing
 

Post Reply  Post Oekaki 
 

Posted By Message

Lobot



Registered
  04/08/2010
Points
  465

WINNER GOTW AUGUST 2010ARGH SignEvil kliker
30th March, 2011 at 09:29:05 -

Hello.
I'm wondering if anyone knows how to make a character sit on a swinging platform? Moving platforms I can handle but swinging is a whole other kettle of fish. Can it be done without the platform swing object (no flash extension)? I've read that you need to test the distance it's moved while on it and adjust it all in real time- I've had no luck, doesn't help that my coding skill are awful.
Any ideas would be greatly appreciated.

 
n/a

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2955

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
30th March, 2011 at 10:13:40 -

I haven't actually tried it yet, but I came up with an idea using trig and the "Move-thing-moved-distance" technique. Check out Pixelthief's article on it:

http://www.create-games.com/article.asp?id=1979

If I do try it out I'll keep you posted!
//EE

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image

Lobot



Registered
  04/08/2010
Points
  465

WINNER GOTW AUGUST 2010ARGH SignEvil kliker
30th March, 2011 at 14:02:37 -

Yes, I read the article by pixelthief- Can't quite figure out the 'set a value to the x pos of the bottom detector' BEFORE the swing moves then move the character the difference from AFTER it moves. In my game the swing is always moving- I don't understand the whole time frame working- makes me feel they the same way I feel when thinking about the terminator plot too much
Doesn't seem to be working for me.

 
n/a

Lobot



Registered
  04/08/2010
Points
  465

WINNER GOTW AUGUST 2010ARGH SignEvil kliker
30th March, 2011 at 14:05:49 -

Thanks for the tip by the way Eternal man.

 
n/a

Don Luciano

Heavy combat pancake

Registered
  25/10/2006
Points
  380

VIP Member
30th March, 2011 at 16:18:56 -

It just means you should move the charachter the same way you move the swing, in the event before the swing moves if the charachter is on it.

 
Code me a sausage!

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
30th March, 2011 at 16:41:07 -

The goal of that technique is to find how much the platform moves each frame by X & Y. So if its on X=100 on one frame, and X=107 on the next, its moved +7 pixels in X. Then the player, who is standing on it somehow, must be moved 7 pixels. So if you record the old position of the platform before moving, and the new position after moving, you can subtract to find the difference, and add this difference to the player's position.

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

Lobot



Registered
  04/08/2010
Points
  465

WINNER GOTW AUGUST 2010ARGH SignEvil kliker
31st March, 2011 at 06:35:08 -

Thanks pixelthief. I've tried this using counters so I can see what's happening. The difference flashes between 1 and 6 pixels- when this is applied to the character's position, he still slides about on the platform... Maybe this measurement is not fast enough? I'm using an in-built path movement for the platform- not sure if this matters... Have you got this approach to work?

 
n/a
   

Post Reply



 



Advertisement

Worth A Click