#9652 - f00l - Tue Aug 12, 2003 11:15 am
uhm.. I would like to know if this is real 3d ...
_________________
woei!
Code: |
#include "mygba.h" #include "gfx/gun.raw.c" // de gun, die zit hier NIET bij #include "gfx/gun.pal.c" // de gun, die zit hier NIET bij MULTIBOOT u8 gun[1]; // de gun, die zit hier NIET bij int main(void) // Het begin van de echte code { ham_Init(); // Even de HAM lib aanspreken u8 i; // I defineren (maakt niet uit welke letter) u8 j; // J defineren (maakt niet uit welke letter) u8 y=80; // Y defineren (maakt niet uit welke letter) u8 z=30; // Z defineren (maakt niet uit welke letter) u8 x=120-z-z; // 120 is het midden en daar hallen 2 x Z af u8 x2=x+z+z+z+z; // 120 is het midden en daar zetten we 2 x Z bij ham_SetBgMode(4); // BG mode instellen // de gun sprite instellen ham_LoadObjPal(&gun_Palette, 256); gun[0] = ham_CreateObj(&gun_Bitmap,0,2,OBJ_MODE_NORMAL,1,0,0,0,0,0,0,110,132); // teken sprite ham_CopyObjToOAM(); TOOL_SET_BG_PAL_256(0,0,0,0) TOOL_SET_BG_PAL_256(1, 0, 0, 128) // Donker blauw TOOL_SET_BG_PAL_256(0,0,0,0) TOOL_SET_BG_PAL_256(2, 0, 0, 255) // licht blauw TOOL_SET_BG_PAL_256(0,0,0,0) TOOL_SET_BG_PAL_256(3, 128, 128, 128) // donker grijs TOOL_SET_BG_PAL_256(0,0,0,0) TOOL_SET_BG_PAL_256(4, 192, 192, 192) // licht grijs while(1) // loop4ever { ham_ClearBackBuffer(0); // BG leeg gooien for(j=0; j<61; j++) // ff snel 61 lijnen teken { ham_PutLine(0,0+j,240,0+j,3); // ff snel 61 lijnen teken ham_PutLine(0,160-j,240,160-j,4); // ff snel 61 lijnen teken } for(i=0; i<61; i++) { ham_PutLine(0,y-z+i,x2,y-z+i,2); // de lijn mode : ham_PutLine(0,y+z-i,x2,y+z-i,2); // X1,Y1 en dan X2,Y2 en kleur ham_PutLine(x2,y-z+i,240,y-z+i,1); ham_PutLine(x2,y+z-i,240,y+z-i,1); ham_PutLine(0,160-i,x,y+z,2); ham_PutLine(0,0+i,x,y-z,2); ham_PutLine(240,160-i,x2,y+z,1); ham_PutLine(240,0+i,x2,y-z,1); } ham_PutLine(0,0,x,y-z,1); ham_PutLine(0,160,x,y+z,1); ham_PutLine(240,0,x2,y-z,1); ham_PutLine(240,160,x2,y+z,1); // Controlls if(F_CTRLINPUT_UP_PRESSED ) { if(z<56){ z++; }} else if(F_CTRLINPUT_DOWN_PRESSED ) { if(z>30){ z--; }} else if(F_CTRLINPUT_LEFT_PRESSED ) { if(x<240){ x++; x2++; }} else if(F_CTRLINPUT_RIGHT_PRESSED ) { if(x>0){ x--; x2--; }} // en weer lekker de BG buffer flippen ham_FlipBGBuffer(); } } |
_________________
woei!