skphysicsbody - Sprite Kit - Shadow on multiple moving object affected impulse and Gravity -


The base of my first question on which was answered (more was explained in the solution commentary and acted like magic)

(This can be a simple answer, but I can leave it or anyone with it).

What if I had another object in a different motion In the Y-axis witch stopped the moving ball already? How can I change the alpha of my shadow on the ball.

To explain it well and make it more confusing, suppose we have a ping pong racket going up and down and a ping pong ball is bouncing. With the formula given earlier, we now know how to make alpha of ping pong racket (first ball) on the ground but what about the shadow of ping pong ball on the racket? How can we change our ambiguity on the racket? Will it be as simple as both rockets using the same formula on a ball :)? It can be used as a class and can be used here and here many times and how do you update it as it takes place in the update?

Here is the code that I have applied with the formula of this aggregate.

  - (zero) update: (CFTimeInterval) current time {{self enumerateChildNodesWithName: @ "shadowOnTheGround" usingBlock: ^ (SKNode * node, bool * off) {SKSpriteNode * racket = (SKSpriteNode * ) [Self childNodeWithName: @ "racket"]; Node.position = CGPXMake (60217); Boat racket y = racket Float theisFormula = (430.0- Reckety) / 430; Node.philip = theisFormula; // NSLog (@ "% f", theisFormula); }]; }  "post-text" itemprop = "text"> 

You can add each shadow node with a specific shadow slope by using . UserData property

  shadowNode.name = @ "shadowOnTheGround" // You get to set NSMutableDictionary * DIC = [NSMutableDictionary dictionaryWithObject: racketNode forKey: @ "Caster"]; // Racketode caster refers to object shadowNode.userData = dic;  

Now, in -update: method,

  - (zero) update: (CFTimeInterval) current time {[self enumerateChildNodesWithName: @ "shadowOnTheGround" usingBlock : ^ (SKN * node, BOLD * stop) {SCSPNode * Caster = (SKSprintNode *) [node. UserData ObjectForcae: @ "Caster"]; // You have your shadow node and it's caster, apply generic code to change the shadow Node.position = CGXXMake (60217); // It is necessary? Float castor y = caster Float theisFormula = (430.0- casterY) / 430; // Make this generic node. Alpha = theisformula; // NSLog (@ "% f", theisFormula); }]; }  

By using this code, you can add many shadows to your specific objects and convert them to a single block of code.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

lua - HowTo create a fuel bar -