Accelerometer in Simulator (+implementation idea)

12 replies [Last post]
jonbeebe
User offline. Last seen 26 weeks 3 days ago. Offline
Joined: 26 Jul 2010

During the development of Doodle Dash! and currently it's sister-title "She Doodle", it became a little time consuming having to build for device to be able to test out the game (due to both being tilt-based controls).

So I came up with an idea... Now I know the Corona simulator AND the Xcode simulator doesn't simulate accelerometer events, so it might not be possible to even do this, but I'll just throw it out there and I'll let the Corona developers decide:

You double click on any part of the simulator window outside of the screen (such as the black part of the iphone), the mouse pointer disappears and now accelerometer events are bound to the mouse movement. For example, you move the mouse to the left, it rotates the "iPhone" to the left and so on.

Having a feature like that I think would make the lives of anyone who uses accelerometer in their apps way easier.

Not something that's really high priority, but would be nice to see maybe by the time final release is out.

Thanks for all the hard work from those who develop Corona SDK!

Jonathan Beebe

Replies

Poonaka
User offline. Last seen 23 weeks 6 days ago. Offline
Joined: 24 Aug 2010

I agree there is a need to be able to test this in the simulator! I like your idea but think it would be even better to have another window appear showing the orientation of the phone. You could then mouse click/rotate the phone in that window on any of the x,y,z axis.

I played around with iTorque a while back. They didn't have any support for it either. However you could bind keyboard keys to some testing functions to help simulate it.

I'm just about to start development on a game that uses the accelerometer and I'm not looking forward building to device all the time.

Matthew Pringle
User offline. Last seen 3 weeks 3 days ago. Offline
Joined: 23 Feb 2010
Matthew Pringle
User offline. Last seen 3 weeks 3 days ago. Offline
Joined: 23 Feb 2010
Tom
User is online Online
Ansca Staff
Joined: 13 Jul 2010

I added this as feature request #921 (internal).

-Tom

MarkHenryC
User offline. Last seen 5 weeks 23 hours ago. Offline
Joined: 11 Nov 2009

If the Corona sim could take external events from the hardware it would be a huge productivity boost. Unity has a loop where it sends a video back to the handset but I don't think this is necessary - at least for testing accelerometer actions.

Matthew Pringle
User offline. Last seen 3 weeks 3 days ago. Offline
Joined: 23 Feb 2010

I developed this joystick to add an input that users can play with and if necessary simulate the accelerometer

http://developer.anscamobile.com/code/joystick

It gives x and y values from -1 to 1 just like the accelerometer and you can set it up with some conditional statements so that if you are in the simulator it is used and if on the device it is hidden and the accelerometer takes precedence.

I use it all the time to simulate different inputs while in the simulator, it saves having to go back to the device all the time.

Not ideal but a good work around I hope!

MarkHenryC
User offline. Last seen 5 weeks 23 hours ago. Offline
Joined: 11 Nov 2009

Good idea. I'm now using it too. Thanks.

Matthew Pringle
User offline. Last seen 3 weeks 3 days ago. Offline
Joined: 23 Feb 2010
IronMan's picture
IronMan
User offline. Last seen 2 days 7 hours ago. Offline
Joined: 5 Jul 2010

can corona use the accelerometer in the macbook pro?
cause i seen some games use that. may be that will be great for development.

GrahamRanson's picture
GrahamRanson
User is online Online
Joined: 29 Mar 2010

Not sure if this has been seen yet but the Simulator for the DragonFireSDK has tilt support as can been seen in this video at around the 1.40 mark - http://www.dragonfiresdk.com/video/index.htm

Matthew Pringle
User offline. Last seen 3 weeks 3 days ago. Offline
Joined: 23 Feb 2010

Mine is getting close to release

http://coronaremote.com/

Matthew Pringle
User offline. Last seen 3 weeks 3 days ago. Offline
Joined: 23 Feb 2010

Corona Remote is now released, accelerometer support in Corona Simulator!

http://www.coronaremote.com/

Viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.