#161953 - Quipeace - Wed Aug 20, 2008 10:26 am
hello everyone,
first off all, im new to nds programming, (its my first post here too by the way) so dont flame me if its very simple to do.
heres the situation:
its my third project so far (did a small mario like thing before this).
I got a sprite that has to be able to move sideways, but NOT up and down (like its on rails), i know this is possible with the pad, but id like to use the stylus if possible.
thanks in advance
EDIT: this is my code so far (please dont mind the comment blocks, i find it hard to read the code without those...
Quipeace[/code]
first off all, im new to nds programming, (its my first post here too by the way) so dont flame me if its very simple to do.
heres the situation:
its my third project so far (did a small mario like thing before this).
I got a sprite that has to be able to move sideways, but NOT up and down (like its on rails), i know this is possible with the pad, but id like to use the stylus if possible.
thanks in advance
EDIT: this is my code so far (please dont mind the comment blocks, i find it hard to read the code without those...
Code: |
#include <PA9.h>
#include "gfx/all_gfx.c" #include "gfx/all_gfx.h" //-----------------------------------Standard Stuff----------------------------------------------\\ int main(int argc, char ** argv) { PA_Init(); PA_InitVBL(); PA_InitText(0,0); PA_SetTextCol(0, 31, 31, 31); s32 x = 0; // Sprite X s32 y = 0; // Sprite Y //------------------------------------End of Stuff-----------------------------------------------\\ /////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// //-----------------------------------LOAD BACKGROUND---------------------------------------------\\ PA_EasyBgLoad(0, 3, pdabot); PA_EasyBgLoad(1, 3, pdatop); //------------------------------------END BACKGROUND---------------------------------------------\\ /////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// //--------------------------------------Load Icons-----------------------------------------------\\ PA_LoadSpritePal(0, // Screen 0, // Palette number (void*)Settingsicon_Pal); // Palette name PA_CreateSprite(0, // Screen 0, // Sprite number (void*)Settingsicon_Sprite, // Sprite name OBJ_SIZE_64X32, // Sprite size 1, // 256 color mode 0, // Sprite palette number 1, 17); // X and Y position on the screen //--------------------------------------END ICONS------------------------------------------------\\ /////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// //----------------------------------------BEGIN--------------------------------------------------\\ while (1) { PA_MoveSprite(0); PA_WaitForVBL(); } return 0; } |
Quipeace[/code]