- Home /
How to make Lerpz Sidescroller work with iPhone Joystick?
Hi is anyone aware of an existing Lerpz sidescroller project configured for iOS Joystick Input?
I'm basically looking for the sidescroll example with joystick input. Not sure if its an easy convert or not, been gutting out the platformer controller script but its not successful at this point. I guess its quite simple but theres acres of code. Getting the character to rotates the right direction is my primary objective. It has to rotateTo absolute, not partially.
Thanks, first couple of names were taken lol :-)
Answer by demize2010 · May 23, 2011 at 01:27 PM
The standard mobile assets have the controls you need ;) I think it even has a side scroller scene.
Ah with the rotate you probably need to add a little bit of script to get him to face down the right axis. So
if the input is + then transform.Rotate(your + direction).
If the input is - then transform.Rotate(your - direction).
The 2D sidescroller example has other dependent scripts for managing the animations. The animation scripts are dependent on PlatformController.js which is 370 lines of code and discarded in this conversion. So its a bit more than 2 lines of code. If anyone knows of the 2d Sidescroller been converted for iOS using Joysticks please post? Thanks
This is an idea for how to go about doing it simply and is pesudo code which you can use IN ADDITION to other code in the project.
$$anonymous$$y apologies, I actually dont want to do it simply, else I wouldnt have needed to post here. Ins$$anonymous$$d of a capsule that not only rotates but retains all the features of the original sidescroller, I'm looking for a real world example. The point is the sidescroller is relatively complex. Converting it to Joystick control is not trivial. Thank you for your input but I was hoping to find a more substantial reference project. Cheers. EDIT: Even getting the rotation working is a hassle, could you please elaborate on your example? Thanks