sprite-kit

iOS ADMOB Reward based video ad failed to load

徘徊边缘 提交于 2019-12-12 04:04:57
问题 until today I was able to show the reward video, but now the video doesn't appear, a log of admod alert me to install the new ADMOB SDK 7.23.0 Now with the new ADMOB SDK the reward video fails to load. with the test id , seems to work: GADRewardBasedVideoAd.sharedInstance().load(GADRequest(),withAdUnitID: "ca-app-pub-3940256099942544/1712485313") if I change with my reference ID, the video fails to load. I've also added in AppDelegate: //ADMOB import GoogleMobileAds func application(_

SpriteKit, Swift - ScrollView Not Showing Up

╄→гoц情女王★ 提交于 2019-12-12 04:02:29
问题 Ok, so I implemented a scrollview by using this method: How to create a vertical scrolling menu in spritekit? Now when I launch the scene it doesn't display anything except a black/ grey background Here is the code I have used in the menu scene: import Foundation import SpriteKit import UIKit //let kMargin: CGFloat = 40 //var backButton = SKSpriteNode() //var selectButton = SKSpriteNode() var moveableNode = SKNode() var scrollView: CustomScrollView! private var imageSize = CGSize.zero var

detect contact when both physics bodies are dynamic sprite kit objective c

蓝咒 提交于 2019-12-12 03:59:25
问题 is it possible to detect a contact and let the object pass the other ? Because I want to increase a variable when they pass each other. I made both phyisicsbodies dynamic, then they pass but didBeginContact is not working anymore then. Thanks EDIT: Okay , so everything is working when I don't have the bodies dynamic. I have a BottomEdgeBody which I use to detect when the raining stones passed my player and then it increases the Score. So, if nothing is dynamic, my stones stay on top of the

How to make a node visible before any user interaction

℡╲_俬逩灬. 提交于 2019-12-12 03:21:49
问题 I took and modified a piece of code which allows me to shoot bullets in every direction. It works perfectly. But it is generating a random bullet in the moment when player touch is ended. I have 6 different bullets and for purposes of my game I need player to see them before he will tap the screen. I tried to initialize a bullet in a global function and pass it to didMoveToView. It's not working, bullet is generating once and stays at its place. That is my code for initializing a bullet:

SKShapeNode Using Wrong Width and Height

爷,独闯天下 提交于 2019-12-12 03:15:42
问题 Recently I have been creating a game where I put circles on the screen. However, I noticed that the circulars were not circles, but in fact ovals. The y axis had been stretched of the x axis had been shrunk. In order to figure out the issue, I am now trying to debug with a rectangle. I made the rectangle have the same height and width (square) however, when turned into an skshapenode it is no longer the correct shape. The code: var testSquare = CGRect(x: CGRectGetMidX(self.frame), y:

Sprite-kit Main Character Picker

不想你离开。 提交于 2019-12-12 03:11:37
问题 I am using swift 2 and sprite-kit. I was wondering how I would make a choose character scene for my player to choose a character to play in the game, I have the scene set up, but I don't know how to integrate multiple characters, that can be chosen as the one to play? Any references or sample code would be appreciated. in GameScene() i have //plane = SKSpriteNode(imageNamed: "plane") plane.size = CGSize(width: 80, height: 80) plane.position = CGPoint(x: self.frame.width / 2, y: self.frame

Detect that SKShapedNode is closed

佐手、 提交于 2019-12-12 03:07:42
问题 In my future game(in SpriteKit), I need to draw circle-like shapes. I use CGMutablePathRef and SKShapeNode for drawing itself. On touchesEnded I need to check if the user did close the circle or if there is a gap between start and end touches. (Strictly saying, it can be not only the right circle, I need to detect any closed shape, e.g. loop...) How can I do this checking? 回答1: Store the touches locations (points) in an array: [yourArray addObject:[NSValue valueWithCGPoint:yourPoint]]; Make a

Make a popup in Sprite kit in Swift

六眼飞鱼酱① 提交于 2019-12-12 03:07:05
问题 I am making a game in sprite kit with swift, when the game over, I want to make a popup appear for viewing scores and re-play. How can I do that? I made that like a SKNode but I think it is not a good way to do when I have too many Node in the popup. 回答1: You could use UIKit. So you could show a semi-transparent ModalViewController if the game is over. That way you can use the Storyboard to design it. Also you can design it in to fit the design of your game and don't have to handle the

iAd freezes Sprite Kit app

跟風遠走 提交于 2019-12-12 02:58:20
问题 I find that tapping on iAds can freeze the screen on any Sprite Kit game. It's not just my specific project, since the stock Sprite Kit example project also freezes with iAd. This does not happen in the simulator though! I cannot decide whether if it's because the simulator runs iOS 8 and my actual testing device is on 7.1, or because of the fact that the simulator is just a simulator so it does things differently. So if you tap on the iAd then click on the link in the iAd to go to safari (or

iAd Freezes App iPhone 5[s][c]

爱⌒轻易说出口 提交于 2019-12-12 02:46:27
问题 My team and I just finished our very first app, and we ran into a problem with iAd. We're still using the Apple developer ads; but if we tap on the Ad, then close out of the ad and click on a node it crashes the app, it seems to only be happening on the iPhone 5[s][c] though, does anyone know what could be causing this? EDIT: We're using SpriteKit. 来源: https://stackoverflow.com/questions/22585840/iad-freezes-app-iphone-5sc