Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using Sce.Pss.Core;
- using Sce.Pss.Core.Environment;
- using Sce.Pss.Core.Graphics;
- using Sce.Pss.Core.Input;
- namespace trololo
- {
- public class AppMain
- {
- private static GraphicsContext graphics;
- public static float red, speed;
- public static bool lol;
- public static void Main (string[] args)
- {
- Initialize ();
- while (true) {
- SystemEvents.CheckEvents ();
- Update ();
- Render ();
- }
- }
- public static void Initialize ()
- {
- // Set up the graphics system
- graphics = new GraphicsContext ();
- red = 0.0f;
- speed = 0.01f;
- lol = true;
- }
- public static void Update ()
- {
- // Query gamepad for current state
- var gamePadData = GamePad.GetData (0);
- if(lol)
- red += speed;
- else
- red -= speed;
- if(red > 1.0f) lol = false;
- if(red < 0.0f) lol = true;
- }
- public static void Render ()
- {
- // Clear the screen
- graphics.SetClearColor (red, 0.0f, 0.0f, 0.0f);
- graphics.Clear ();
- // Present the screen
- graphics.SwapBuffers ();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement