public BasicScene(CGSize size) : base(size) { ScaleMode = SKSceneScaleMode.AspectFill; //BackgroundColor = UIColor.FromRGBA (0.15f, 0.15f, 0.3f, 1f); bgr = new SKSpriteNode(SKTexture.FromImageNamed("brickwall1")); bgr.Size = Size; bgr.Position = new CGPoint(Size.Width / 2, Size.Height / 2); AddChild(bgr); UnselectedColor = UIColor.FromRGBA(0f, 0.5f, 0.5f, 1f); SelectedColor = UIColor.FromRGBA(0.5f, 1f, 0.99f, 1f); ButtonColor = UIColor.FromRGBA(1f, 1f, 0f, 1f); InfoColor = UIColor.FromRGBA(1f, 1f, 1f, 1f); FrameMidX = (float)Frame.GetMidX(); FrameMidY = (float)Frame.GetMidY(); transition = SKTransition.MoveInWithDirection(SKTransitionDirection.Right, 0.3); }
void GameOver() { SKTransition reveal = SKTransition.FlipHorizontalWithDuration(0.5); var gameOverScene = new GameOverScene(Size, (int)score); View.PresentScene(gameOverScene, reveal); }
public BasicScene (CGSize size) : base (size) { ScaleMode = SKSceneScaleMode.AspectFill; BackgroundColor = UIColor.FromRGBA (0.15f, 0.15f, 0.3f, 1f); UnselectedColor = UIColor.FromRGBA (0f, 0.5f, 0.5f, 1f); SelectedColor = UIColor.FromRGBA (0.5f, 1f, 0.99f, 1f); ButtonColor = UIColor.FromRGBA (1f, 1f, 0f, 1f); InfoColor = UIColor.FromRGBA (1f, 1f, 1f, 1f); FrameMidX = (float)Frame.GetMidX (); FrameMidY = (float)Frame.GetMidY (); transition = SKTransition.MoveInWithDirection (SKTransitionDirection.Up, 0.5); }
public BasicScene(CGSize size) : base(size) { ScaleMode = SKSceneScaleMode.AspectFill; BackgroundColor = UIColor.FromRGBA(0.15f, 0.15f, 0.3f, 1f); UnselectedColor = UIColor.FromRGBA(0f, 0.5f, 0.5f, 1f); SelectedColor = UIColor.FromRGBA(0.5f, 1f, 0.99f, 1f); ButtonColor = UIColor.FromRGBA(1f, 1f, 0f, 1f); InfoColor = UIColor.FromRGBA(1f, 1f, 1f, 1f); FrameMidX = (float)Frame.GetMidX(); FrameMidY = (float)Frame.GetMidY(); transition = SKTransition.MoveInWithDirection(SKTransitionDirection.Up, 0.5); }
public GameOverScene(SizeF size, int score) : base(size) { BackgroundColor = new UIColor(0.15f, 0.15f, 0.3f, 1.0f); SKLabelNode label = SKLabelNode.FromFont("Chalkduster"); label.Text = "Your final score is: " + score + " Points"; label.FontSize = 30f; label.FontColor = UIColor.Black; label.Position = new PointF(Size.Width / 2, Size.Height / 2); AddChild(label); RunAction(SKAction.Sequence(new [] { SKAction.WaitForDuration(3), SKAction.RunBlock(() => { SKTransition reveal = SKTransition.FlipHorizontalWithDuration(0.5); var scene = new MyScene(size); View.PresentScene(scene, reveal); }), })); }