0

Me and a friend have started creating a platform game using sprite kit in Xcode. We are creating the levels using the program tiled which consists of the main layer and objects layer. We are currently having issues adding a contact bit mask to the object layer in the map. We want the player to be able to make contact with our objects such as crates, floors, coins, health kits etc.

Any help on how to do this would be greatly appreciated.

Santhosh
  • 8,181
  • 4
  • 29
  • 56
PoisonedApps
  • 716
  • 8
  • 21
  • What part of the process exactly are you having problems with? – CodeSmile Mar 24 '14 at 10:34
  • Well the whole process really. We are fairly new to programming so just need a starting hand. We can load the tmx maps just fine but we just don't know how to handle the collision aspect of it. I have looked around stack over flow and used google a fair amount but neither have yielded solid results. If you point us in the right direction that would be great and much appreciated. – PoisonedApps Mar 28 '14 at 01:39

1 Answers1

1

You can use sprite kit's physics engine to handle objects interacting with each other. That's generally called collision detection.

Se this link for more information, it's in a more general overview with some apple source code for their sample game "adventure".

https://developer.apple.com/library/ios/documentation/GraphicsAnimation/Conceptual/CodeExplainedAdventure/HandlingCollisions/HandlingCollisions.html

You might already be using SK physics, so here's a more specific rundown. http://www.techotopia.com/index.php/An_iOS_7_Sprite_Kit_Collision_Handling_Tutorial

Good luck!

slycrel
  • 4,275
  • 2
  • 30
  • 30