Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I want to create a game kite flying . Now suppose we have two button's Up and down. When we press on button up kite go away from screen and it should look realistic small while its going away and away on continues press . If we press on down it should come down in same way and it look bigger .
How can show kite depth on screen with sprite kit or any other framework ?
Thanks
Rajender
You could try adjusting the Scale property of the SKNode when a user presses the up button. You'll have to detect the specific key type that you're looking for, but you could do something like:
- (void)handlePressDown:(UIGestureRecognizer)recognizer
{
// ....Detect specific keystroke
_kiteScaleAmount++;
[kite setScale:_kiteScaleAmount];
}
More info on SKNode here.
Since you included the [scenekit] tag in your question, perhaps you're also looking for 3D solutions?
You can use SK3DNode to add 3D content—an embedded SceneKit scene—to your otherwise 2D SpriteKit game. So, if you have a 3D model of a kite, you can build a SceneKit scene around that, then attach it to an SK3DNode in your game. Then, to make the kite get farther and nearer to the viewer, adjust the camera in the SceneKit scene.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
how can we make a ball when ever you step on it it rotates in the direction like when you step on ball on real life i serched it on internet but i cant find any result please If anyone have a solution please reply me
Maybe I'm not understanding your question right, but simple spherical parts act like that due to the physics engine. It might not be obvious how they rotate, because of the default material. So try the following: Create an empty game and put the following as a script into your workspace and do nothing else:
local ball = Instance.new("Part", workspace)
ball.Shape = Enum.PartType.Ball
When you now start the game, you'll stand exactly on top of the ball and when walking forward, the ball will turn into the direction as you would expect. Now you can chase it and jump on it, etc.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I am not able to detect surface using ARKit. I have also added the image of the surface.
How to detect a surface with less texture accurately?
To successfully detect a horizontal or vertical plane using ARKit or RealityKit you need to track:
surfaces with distinguished textures;
in a well-lit environment;
you must physically move around a room;
You do not need to track:
surfaces with "poor" or repetitive textures;
glare, reflective or refractive surfaces;
transparent objects (like glass tables);
However, to overcome most of these limitations, you can use the iPad Pro with a LiDAR scanner. iPad Pro 2020 detects surfaces at unprecedented speed (at tens of nanoseconds) in a poorly-lit room.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want to dynamically create realistic clouds including their movement and multiplication (density). I found this link which seem to explain more than I can understand. I cannot find a way to replicate the clouds and there is practically no other tutorial online. Does anyone know how can I achieve this result? Thank you in advance!
use scene kit you can make a dynamic particle effect:
https://developer.apple.com/library/prerelease/ios/samplecode/SceneKitVehicle/Introduction/Intro.html
in this example you can find, after the vehicles code, the smoke animation. You can gat all the stuff you need from there, like smoke.scnp, smoke.png.
You need to change some row of code like the smoke color, the light color and the camera position.
But with that i guess you can have one of the best result possible, as real time cloud simulation, in iOS.
(other solution would be using openGL but trust me this is a ton easier)
maybe this guide can also be useful to understand the basis (you just need them to achieve your clouds) :
http://www.raywenderlich.com/83748/beginning-scene-kit-tutorial
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
What I'm trying to do seems very simple, yet I'm struggling to make it work. I'm creating a simple SpriteKit game, similar to FlappyBird. The main character stays vertically stationary while the user controls its horizontal motion. That part is no problem. At the same time, other game elements should be moving vertically at a constant speed. I need to detect contact, but do not need to react with physics to the contact (the moving elements either disappear on contact, or the contact causes game to end).
I've tried using physicsBody.velocity, but the results are erratic. Conceptually, this is my desired approach because I want to control the velocity, speeding or slowing as the game progresses.
I've also tried using Actions, and this works ok but it's challenging to create constant motion, and it's difficult to imagine how to speed and slow the motion with Actions. My best results are with SKAction.sequence, but have difficulty coordinating multiple elements to move in sync.
Any clues would be most appreciated.
You can create the host node – world: SKNode to control all the moving objects – just add them as childs. And use that node to rule the world – set world.speed = 0.0 to stop all SKActions, world.speed = 2.0 to move them twice as faster
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
In the Image above (Top Image), suppose the black boundary is the phone.
What i was trying to achieve is to randomly generate the red path from the top of the screen and at the same time the red line (path) moves downwards.
Notice how the red path is random and does not have a uniform shape.
My question is how do i achieve this?
I know this has something to do with the random function.
But then generating the random path has been my main obstacle since 8 hours.
I could not generate a shape at every interval of the timer with a specific x coordinate and y coordinate but then as you can see in the next image, how would i generate the line at an angle (rotated)
Have tried hard to search everywhere on the internet but failed.
I always keep stackoverflow my last destination after I fail to achieve any functionality after numerous hours.
Would really appreciate if anyone could help me out with this.
It looks like you could achieve the effect you wish by starting at the top center, and repeatedly choosing 2 random numbers: how far down to go, and how far horizontally to go (positive or negative), until you got to the bottom of the screen. You'd have to be careful not to go off either edge, or you could instead choose a random x-coordinate each step.