Is it possible to simulate motion/collisions in GameScene for iOS? - ios

I have an idea for a game in iOS but I would need to be able to simulate a wide range of physicsWorld possibilities for the game to work.
I can probably do this manually, but I'm not sure that it would be realistic to do this in real time (I would need to perform the calculations on the fly prior to new game setups). I'm wondering if there's anything built in for iOS.

Related

Placing objects automatically when ground plane detected with vuforia

I'm working on an application where the concept is that you can 'select' objects before actually placing them. So what I wanted to do was have some low quality objects on a shelf or something like it. When the user selects the object he then can tap to place the high quality version of the object in his area for further viewing.
I was wondering if it's possible with vuforia. I wanted to use this platform since it works well from what I could tell and it's cross platform (The application needs to be for android and the HoloLens).
I have set up the basic application where you can place a capsule in the area. Now I wanted to automatically place the (in this case capsule) once vuforia has detected a ground plane. From what I could see the plane finder has events that go off when an input is detected, but I couldn't find an event that goes off when the ground plane is detected. Is it still possible with vuforia? I know it's doable with the HoloLens, but I would like to know if it's possible for android or other mobile devices. I really don't know where to start/look for so I hope someone can point me in the right direction.
Let me know if I need to include more information!
The Vuforia PlaneFinderBehaviour (see doc here) has the event OnAutomaticHitTest which fires every frame a ground plane is detected.
So you can use it to automatically spawn an object.
You have to add your method in the On Automatic Hit Test instead of the On Interactive Hit Test list of the "Plane Finder":
I've heard that vuforia fusion, does not yet support ARCore (it supports ARKit) so it uses an internal implementation to simulate ARCore functionality, and they are waiting for a final release of ARCore to support it. Many users reported that their objects move even when they use an ARCore supported device.

how can i move an object while the iphone is being shaken in objective c

I am creating an iphone project where I need to make a ball move in the same direction of the shake while the device is being shaken.. and then take a certain speed and path when the shake event ends.
I have searched the net and have only posts that can detect a shake effect after which you will be able to run a preset animation that you want.. and I have found many tutorials where you can make a ball move depending on the tilt of the screen.. however what I would like to do, is make the ball move depending on all criterias: shake rythm, shake speed, and giroscope tilt.. is that possible?
Thanks
To do this accurately you must use Core Motion framework, specifically CMMotionManager class. Depending on the device capabilities this class provides both accelerometer and gyroscope data.
To get the ball moving in correct way, this would require a function that would translate the received data from CMMotionManager into values you can animate. That is hard to guess, so I suggest creating a basic function that detects the force and direction and then tuning the parameters by testing.

How to move "obstacle" objects. Corona SDK Physics Box2D. Physics Update?

I'm trying to understand the proper way to move "obstacle" objects in corona/box2d. I want to know how to write my code so that the movement is deterministic and in-step with the physics engine. Is this possible?
I'm familiar with Unity which has a physics update (FixedUpdate). Where you can add a bit of code to execute on every physics step. This keeps the physics deterministic, frame and system time independent.
For example, in my game I want to do things like: Make a platform that moves back and forth, make an object that scales up and down in size. I would still like the physics to work properly and allow the ball in my game to bounce off of these for example. Depending on the case, I imagine that I should use either kinematic or dynamic bodies.
I've searched around and the way to periodically manipulate these objects is to use:
timer.performWithDelay. But this has an issue mentioned in the docs "Timers run on system time. If the app is suspended, running timers will not be automatically paused"
Listening to an enterFrame event. But this has a similar issue, if the frame rate drops then the object won't be moved enough. We can use delta time to deal with this, but this has determinism issues (moving an object too much on a lag spike).
transition.to. I'm guessing this is implemented with timer.performWithDelay and has the same issues.
I don't think that any of these will behave deterministic. Any suggestions? Thanks for the help.
You should really use:
object:setLinearVelocity(xVelocity, yVelocity)
or
object:applyForce(xForce, yForce)
instead of transition.to.

SpriteKit: Should I pan the camera or move the background?

When building a game with SpriteKit, with a platformer game (like Doodle Jump for example), is it preferable to move the camera up, or the background nodes down ?
What is the standard practice in other frameworks ?
MOVE THE CAMERA!!!
One of the weirdest things about 2D game engines is that it often takes them a series of versions to get a camera.
They should be born with them.
SpriteKit was no different, it took forever to get a camera.
Now that it has one, never ever think of not using it.
Will make your life a million times simpler.
I can think of no exceptions, but look forward to being proven wrong.
move background was HOTFIX until proper cam support added.
use the cam. its easy and fun. no reason to not imo.

How to add continuous movement to iPad app

I'm writing a 3d car designer ipad app and I want to add a little "life" to it. I want it to be similar to what "3D Car Builder" iPad app does, in that from the moment the app starts, there's just the slightest amount of "movement" in the scene. Even if the iPad is sitting on the table, there's movement going on.
I'm testing on a 1st gen iPad, so whatever they've implemented, works on my device. I have (iOS 5 installed). I've looked up several things, thinking this was developed with the accelerometer, or possibly magnetometer, core motion of some sort...I can't figure out where to start. It might something as simple as moving the 3D scene in the x direction for a small amount, then y-direction, the negative x, then negative y. I dunno, it's something simple.
Anyone know how I/they might have implemented this?
Okay, nevermind...I figured this one out. Worked great using CCActionInterval

Resources