Lerpz Lives!

I took the 2D platform example game and “ported” it to the iPhone. I changed the input to use accelerometer and touch input and fixed a couple of JS things the compiler complained about.

I think it runs really well, but see for yourself!

I should also point out that this not in any way optimized for the iPhone. I just copied the 2d platformer and hit build pretty much. I think it is running about double the recommended budget for polys.

nice job!

nice! :slight_smile:

looks nice :slight_smile:

when you say you changed the input do you mean via scripting or via the input manager?

thanks

gj, man

almost makes me want to create a platform game for the phone :slight_smile:

Unity3D for Iphone of great interest.

ps: no money to buy Iphone, crying!!

I just modified the existing input scripts a bit to use the iPhone input.

thanks tigeba for the video!!

That was one of the coolest first posts to the forums ever. Welcome to the community!

@tigeba: thanks! I haven’t bought Unity quite yet. I am really pleased to see your port of the 2d platformer tutorial.

I am already making one … Platform Dream … a dreamy one for kids. On the home page … http://www.cocoatouchgames.com/

Once I get the four in front of it out the door.

I’m curious… have you tried running this through Xcode’s Instruments? I would like to know how the memory usage is on a game with textures and objects like that.

By the way… looks great!! I can tell the frame rate wasn’t at 100% but it still looks d@mn good and I’m sure iphone users will love the graphics.

share source? please! :smile:

Gah, why didn’t we think of trying that. :slight_smile: Great job.

Cheers,
-Jon

The complete source is already available as it’s a tutorial, or do you mean the few changes in the lines to use iPhoneInput.accelerometer.x instead of Input.GetAxis(“Horizontal”) or whatever?

Cheers,
-Jon

it gives me a lot of errors like:
Assets/Scripts/2D/LevelAttributes.js(51,21): BCE0019: ‘center’ is not a member of ‘UnityEngine.Component’.

how do i fix these?

The iPhone version can’t use dynamic typing at all ( I believe ) so you just need to cast or type some of the variables to get it to build.

instead of
var foo;

try
var foo:Rigidbody

Or whatever type might be appropriate for the situation.

Yep, as stated it’s because of dynamic typing which due to iPhone limitations is not supported.

Here’s a package with the changes. Using iPhone input is left as a study. :slight_smile:

Cheers,
-Jon

98877–3834–$2dplatformerstatictypingchange_129.unitypackage (12.5 KB)

Thanks Guys!

I cant find your package…

Package wouldn’t download initially - came out of safari and back in and all fine. Thanks very much. Now runs. But have this error - doesn’t seem to matter at present.

owner->m_VisibleObjects.find (slot) != owner->VisibleObjects.end ()

And says:
Assert in file: /Users/joe/iphone-clean/Projects/…/Runtime/Camera/Culler.cpp at line: 113

Should we worry?

Jon – I want to know when, at the conference, you found time to remove dynamic typing from an example.