]> 4ch.mooo.com Git - 16.git/commitdiff
inputest manipulates d and q like scroll.exe
authorsparky4 <sparky4@cock.li>
Sun, 13 Mar 2016 03:07:43 +0000 (21:07 -0600)
committersparky4 <sparky4@cock.li>
Sun, 13 Mar 2016 03:07:43 +0000 (21:07 -0600)
src/inputest.c
src/scroll.c

index c0c3792e6922fca61e49aed35e9c145a3569d45a..f490ab28aee614f6de91869e4be22f105e7b7ef4 100755 (executable)
@@ -1,5 +1,5 @@
 /* Project 16 Source Code~\r
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ * Copyright (C) 2012-2015 sparky4 & 0gwen & andrius4669\r
  *\r
  * This file is part of Project 16.\r
  *\r
@@ -35,9 +35,52 @@ main(int argc, char *argv[])
        IN_Startup();\r
        IN_Default(0,&player,ctrl_Joystick);\r
        //while(!IN_KeyDown(sc_Escape))\r
+       player[0].q=1;\r
+       player[0].d=2;\r
+       player[0].persist_aniframe=0;\r
+       player[0].speed=4;\r
        while(!IN_KeyDown(sc_Escape))\r
        {\r
+               #define INC_PER_FRAME if(player[0].q&1) player[0].persist_aniframe++; if(player[0].persist_aniframe>4) player[0].persist_aniframe = 1;\r
                IN_ReadControl(0,&player);\r
+               switch(player[0].d)\r
+               {\r
+               //right movement\r
+               case 3:\r
+                       if(player[0].q<=(TILEWH/(player[0].speed)))\r
+                       {\r
+                               INC_PER_FRAME;\r
+                               player[0].q++;\r
+                       } else { player[0].q = 1; player[0].d = 2; }\r
+               break;\r
+\r
+               //left movement\r
+               case 1:\r
+                       if(player[0].q<=(TILEWH/(player[0].speed)))\r
+                       {\r
+                               INC_PER_FRAME;\r
+                               player[0].q++;\r
+                       } else { player[0].q = 1; player[0].d = 2; }\r
+               break;\r
+\r
+               //down movement\r
+               case 4:\r
+                       if(player[0].q<=(TILEWH/(player[0].speed)))\r
+                       {\r
+                               INC_PER_FRAME;\r
+                               player[0].q++;\r
+                       } else { player[0].q = 1; player[0].d = 2; }\r
+               break;\r
+\r
+               //up movement\r
+               case 0:\r
+                       if(player[0].q<=(TILEWH/(player[0].speed)))\r
+                       {\r
+                               INC_PER_FRAME;\r
+                               player[0].q++;\r
+                       } else { player[0].q = 1; player[0].d = 2; }\r
+               break;\r
+       }\r
                //printf("%u\n", IN_KeyDown(sc_Escape));\r
                //if(\r
                IN_qb(sc_9);//>0) printf("IN_qb(sc_9)=%u\n", IN_qb(sc_9));\r
index 4b9e9ba528bf8ab64337ccaa32a6b1561de70fa1..6fdee8a648ac54d322720e0d692cf79046cc23b7 100755 (executable)
@@ -65,7 +65,6 @@ void main(int argc, char *argv[])
        else bakapee = 1;
 
        testcontrolnoisy=1;
-       gfxtest=1;
 
        player[0].persist_aniframe=0;
        player[0].speed=4;