/* 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
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