ios - Blast Radius Spritekit -


I am trying to create an explosion, when a certain object is killed, the object in the nearest radius will also be destroyed Go. For example, in a brick breaker game, the ball hits a brick and then the brick bursts, as well as two bricks in every direction. How can this be accomplished? Any help is appreciated.

There are so many ways to do this, but to make the path of spritekit is an explosion Phantom node you SKAction You can animate it as needed and use the same Spritekit physics contact logic with other sprites.

Add Physical Science Contact Category Bit Masks to Explode Nodes. When an event occurs, then the explosion should arise, call a method that creates an explosion node at the point of occurrence. Set the explosion node state at the point Add any function to the explosion node. Add explosion node to the view. Its functions will be running in Physics Contact Representative method, didBeginContact: You test for the contact of any node of those categories that should react to contact with the explosion node. If the contact is done, the basic thing is that once you work with Firefox to remove the contact node, you can be fancy.

Your blast node should probably be taken to the physical body of a circle based on a CGPath.

You should probably experiment with those actions which scale it up and down, you can get more sophisticated by adding actions that provide animation, sound etc. for the destruction of other nodes, remove them before. If they are a custom sub-class, then it is a good time for a protocol that method name is blown and removed. Then each class has to apply to it. Looks like a work but your game keeps the logic code clean.

This overall process is becoming common and you will be familiar with one.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -