jjzjj

jumpHitBox

全部标签

ios - 我小时候在我的玩家类中为我的玩家制作了一个 Hitbox Sprite 。我如何在 gamescene 的 didBegin 方法中访问那个 hitbox Sprite ?

这个“hitbox”的目的是让玩家只能在地面/平台上行走时跳跃。hitbox比玩家宽一点,并且在玩家的脚上。这是我的播放器类:classPlayer:SKSpriteNode{letmaxPlayerSpeed:CGFloat=300staticvarisPlayerOnGround=falseinit(){//playerstexturelettexture=SKTexture(imageNamed:"playerMove1")super.init(texture:texture,color:SKColor.clear,size:texture.size())//hitboxthat