11// @ts -check
22
33import "@nativescript/macos-node-api" ;
4- import "@nativescript/macos-node-api/SpriteKit" ;
5- import "@nativescript/macos-node-api/GameController" ;
6- import "@nativescript/macos-node-api/CoreFoundation" ;
7- import "@nativescript/macos-node-api/CoreGraphics" ;
4+ import "@nativescript/macos-node-api/SpriteKit.d.ts " ;
5+ import "@nativescript/macos-node-api/GameController.d.ts " ;
6+ import "@nativescript/macos-node-api/CoreFoundation.d.ts " ;
7+ import "@nativescript/macos-node-api/CoreGraphics.d.ts " ;
88
99objc . import ( "SpriteKit" ) ;
1010objc . import ( "GameController" ) ;
@@ -41,7 +41,7 @@ export class ApplicationDelegate extends NSObject {
4141 118 / 255 ,
4242 171 / 255 ,
4343 235 / 255 ,
44- 1
44+ 1 ,
4545 ) ;
4646
4747 window . acceptsMouseMovedEvents = true ;
@@ -81,7 +81,7 @@ export class BattlefieldScene extends SKScene {
8181 this ,
8282 "controllerDidConnect" ,
8383 GCControllerDidBecomeCurrentNotification ,
84- null
84+ null ,
8585 ) ;
8686 }
8787
@@ -94,7 +94,7 @@ export class BattlefieldScene extends SKScene {
9494 indicatorSize . height = indicatorHeight ;
9595 this . indicator = SKSpriteNode . alloc ( ) . initWithColorSize (
9696 NSColor . colorWithSRGBRedGreenBlueAlpha ( 0 , 1 , 0 , 1 ) ,
97- indicatorSize
97+ indicatorSize ,
9898 ) ;
9999 this . indicator . position = {
100100 x : this . frame . size . width / 2 ,
@@ -105,7 +105,7 @@ export class BattlefieldScene extends SKScene {
105105 const heroSize = { width : 25 , height : 25 } ;
106106 this . hero = SKSpriteNode . alloc ( ) . initWithColorSize (
107107 NSColor . colorWithSRGBRedGreenBlueAlpha ( 0 , 0 , 1 , 1 ) ,
108- heroSize
108+ heroSize ,
109109 ) ;
110110
111111 const heroPhysicsBody = SKPhysicsBody . bodyWithRectangleOfSize ( heroSize ) ;
@@ -123,7 +123,7 @@ export class BattlefieldScene extends SKScene {
123123 const villainSize = { width : 50 , height : 50 } ;
124124 this . villain = SKSpriteNode . alloc ( ) . initWithColorSize (
125125 NSColor . colorWithSRGBRedGreenBlueAlpha ( 1 , 0 , 0 , 1 ) ,
126- villainSize
126+ villainSize ,
127127 ) ;
128128
129129 const villainPhysicsBody =
@@ -171,7 +171,7 @@ export class BattlefieldScene extends SKScene {
171171 currentPos ,
172172 targetPos ,
173173 deltaTime ,
174- currentRotationInRadians
174+ currentRotationInRadians ,
175175 ) {
176176 const xDiff = targetPos . x - currentPos . x ;
177177 const yDiff = targetPos . y - currentPos . y ;
@@ -200,8 +200,8 @@ export class BattlefieldScene extends SKScene {
200200 extraRotation < - 180
201201 ? 360 + extraRotation
202202 : extraRotation > 180
203- ? extraRotation - 360
204- : extraRotation ;
203+ ? extraRotation - 360
204+ : extraRotation ;
205205 const optimalEasedRotation = optimalRotation / easing ;
206206 const newRotationInDegrees =
207207 ( currentRotationInRadians + optimalEasedRotation ) % 360 ;
@@ -233,14 +233,14 @@ export class BattlefieldScene extends SKScene {
233233 this . villain . position ,
234234 this . hero . position ,
235235 idealDeltaTime ,
236- this . villain . zRotation
236+ this . villain . zRotation ,
237237 ) ;
238238 const forHero = this . diffFn (
239239 this . heroBaseSpeed ,
240240 this . hero . position ,
241241 this . heroTargetPos ,
242242 idealDeltaTime ,
243- this . hero . zRotation
243+ this . hero . zRotation ,
244244 ) ;
245245
246246 this . villain . zRotation = forVillain . rotation ;
0 commit comments