Head movement detection - iOS - ios

Someone asked me if is it possible to detect the head movement of someone using the iPhone's camera. It's because that the person wants to detect when his head touches some random objects falling from above.
This game represents almost what I'm trying to say. Is it possible to use the camera to detect someone's head movement or other part of the body to avoid the ball touching the ground? Not using your fingers over the screen, or the movement of the device.
Do you think it could possible? Because I haven't see any app / game using someone's movement. And if is possible in iOS... would it be possible to do it on Android?
Thanks in advance.

Have a look at this Apple demo code, it's pretty close to what you're after:
http://developer.apple.com/library/ios/#samplecode/SquareCam/Introduction/Intro.html

Related

Making a Platform game with Corona SDK

I'm trying to develop a platform game similar to Geometry Dash but i'm facing a lot of problems during the making of the algorithm.
I don't barely know how to proceed. Are the levels structured with a long image ( that is the ground) with obstacles added, or there are many obstacles generated progressively during the game?
I'd like to know where to start from, what to draw and how to place it in my game, how to build the collision detection.
The game will be an auto-scrolling platformer, so, will the character's asset be moving right or will all the level except for the character be moving left?
I'm a beginner, so i would like to receive detailed answers and not too difficult to understand. Thank you.
if you have any advice I would gladly listen to it.
I've done all corona tutorials but they doesn't explain how to do a platformer. - Luca Pasini
Looks like you still don't feel how game work from inside. Tutorials probably will not help you much. I think you need to start something very simple by your own - not by tutorials.
For example:
Show red rectangle
Show blue recatngle
Tap on the screen and red rectangle must change his position (not by transitions - just by core x,y change)
If they are collide - show text: "You win". Collision check just by raw calculations.
Then go with updates, that will make it looks more like a game.

Is there a way to calculate small distances with CoreMotion?

Is it possible to calculate small distances with CoreMotion?
For example a user moves his iOS device up or down, left and right and facing the device in front of him (landscape).
EDIT
Link as promised...
https://www.youtube.com/watch?v=C7JQ7Rpwn2k position stuff starts at about 23 minutes in.
His summary...
The best thing to do is to try and not use position in your app.
There is a video that I will find to show you. But short answer... No. The margin for error is too great and the integration that you have to do (twice) just amplifies this error.
At best you will end up with the device telling you it is slowly moving in one direction all the time.
At worst it could think it's hurtling around the planet.
2020 Update
So, iOS has added the measure app that does what the OP wanted. And uses a combination of accelerometer and gyroscope and magnetometer in the phone along with ARKit to get the external reference that I was talking about in this answer.
Iā€™m not 100% certain but if you wanted to do something like the OP was asking you should be able to dig into ARKit and find some apis in there that do what you want.
šŸ‘šŸ»

How to simulate water in a bottle type of physics using accelerometer using Corona SDK?

I'm developing a gaming application where the user must shake his or her iphone to get objects to move around hitting the borders of the phone. Similar to how water behaves in a bottle.
I know that we can tilt the device to cause a pinball effect, but can we shake the device like shaking a bottle of water?
Thank you in advanced.
With the help of Accelerometer, you can get parameters you need. And in every frame, according to parameters, you can change gravity or apply force to physics objects.
https://docs.coronalabs.com/api/event/accelerometer/index.html
I recommend you to use Instant parameters. You can change gravity according to that.

Flash - Detect tilting iOS

I've got a sample game here, and I wanted to give it a try on the iPad.
How do I listen for tilting in flash?
If I have a standard space invaders game, I want to move the spaceship left and right when I'm tilting the device left and right. How do I do this?
Thanks! =)
Did you try AccelerometerEvent? Here's a tutorial and sample application using accelerometer to control the ball movements: http://www.gotoandlearn.com/play.php?id=116

Motion detection of iOS device in 3d Space

Ive been working with the iOS sensors a bit off late and i wanted to write an app that would accurately track the motion of the phone in space. I wanted to know if its possible to track the motion of the device and detect gestures, such as drawing a circle with your phone or even moving in a straight line.
I've been searching online about this, and i wanted to know two things:-
1.Is it possible to do this with the CoreMotion framework.
2.If Yes, what is the alternative for older devices that do not support CoreMotion. Without the double integral method using the accelerometer!
This would really help!
Any other alternative ideas are most welcome!
Thanks in advance!
As your write, you cannot do the double integral.
For gesture recognition, I would try dynamic time warping. See my earlier answer here.

Resources