Posts

Post not yet marked as solved
1 Replies
898 Views
I have Xcode 14.3.1 /////START of Code import SpriteKit import GameplayKit class PlayerControlComponent : GKComponent, ControlInputDelegate { var touchControlNode : TouchControlInputNode? func setupControls (camera: SKCameraNode, scene: SKScene){ touchControlNode = TouchControlInputNode(frame: scene.frame) touchControlNode?.inputDelegate = self touchControlNode?.position = CGPoint.zero camera.addChild(touchControlNode!) } func follow(command: String?) { print("command:(String(describing: command))") } } ///////End of code I have no error in project and the simulator shows launch screen then precedes to what I have on the game scene when I have no component in the component inspector of the the Sprite(player) when I add a component to the component inspector of the Sprite(player) that is when, after the launch screen, it is a grey screen. The component is supposed to add the controls I created in the TouchContorolNode file and have the camera and controls so as the player moves the controls follow the Sprite(player). Does anyone know why the screen is turning Grey after the launch screen with the comment attached to the Sprite(player)?
Posted
by Saturn87.
Last updated
.
Post not yet marked as solved
0 Replies
429 Views
move sprite in SpriteKit along x and y but within a playable area so they do it walk on the “houses” but still jump which would have them overlap the house since this is 2D game any advice? I have tried playable rect but I get the fatal error and not sure how to set up the vectoring so the player can still jump and kick even whne not affected by gravit.
Posted
by Saturn87.
Last updated
.
Post not yet marked as solved
0 Replies
779 Views
I am trying to make player move up and done on a region and jump but I am only able to create the bounded rectangle and make player affected by gravity so they can move along the x axis. I have a street background with houses and want them to be able to move along the width and height of the street and jump but when I make player affected by gravity there is no way to keep it on the street part of the background. do I use SKregion? and how do I implement if I do and create the shadow? Thanks for all feedback
Posted
by Saturn87.
Last updated
.