Advertisement
xerpi

lol

Apr 7th, 2012
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.10 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. using Sce.Pss.Core;
  5. using Sce.Pss.Core.Environment;
  6. using Sce.Pss.Core.Graphics;
  7. using Sce.Pss.Core.Input;
  8.  
  9.  
  10. namespace trololo
  11. {
  12.     public class AppMain
  13.     {
  14.         private static GraphicsContext graphics;
  15.         public static float red, speed;
  16.         public static bool lol;
  17.        
  18.         public static void Main (string[] args)
  19.         {
  20.             Initialize ();
  21.             while (true) {
  22.                 SystemEvents.CheckEvents ();
  23.                 Update ();
  24.                 Render ();
  25.             }
  26.         }
  27.  
  28.         public static void Initialize ()
  29.         {
  30.             // Set up the graphics system
  31.             graphics = new GraphicsContext ();
  32.             red = 0.0f;
  33.             speed = 0.01f;
  34.             lol = true;
  35.            
  36.         }
  37.  
  38.         public static void Update ()
  39.         {
  40.             // Query gamepad for current state
  41.             var gamePadData = GamePad.GetData (0);
  42.             if(lol)
  43.                 red += speed;
  44.             else
  45.                 red -= speed;
  46.            
  47.             if(red > 1.0f) lol = false;
  48.             if(red < 0.0f) lol = true;
  49.         }
  50.  
  51.         public static void Render ()
  52.         {
  53.             // Clear the screen    
  54.             graphics.SetClearColor (red, 0.0f, 0.0f, 0.0f);
  55.             graphics.Clear ();
  56.  
  57.  
  58.             // Present the screen
  59.             graphics.SwapBuffers ();
  60.         }
  61.     }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement