|
Old school 2D sprites
#395658
02/26/12 07:50
02/26/12 07:50
|
Joined: Feb 2012
Posts: 9
Enix
OP
Newbie
|
OP
Newbie
Joined: Feb 2012
Posts: 9
|
Guys, I know now you could be annoyed because this is probably written somewhere. But I am so eager to start, so I ask for help. I would like to make old-fashioned 2D platformer with sprites so I need something like this: { my_sprite, my_sprite.bmap, sprite.size, sprite.animate, sprite.move ; } But I don `t know the real and proper command line. So any example of code here, references to manual, AUM, and forums are welcome. Is sprite bitmaps for GameStudio should look like this? You know, just different pictures in a row. http://goo.gl/oIgnBIf so, how do I tell to GameStudio the size of the sprite (128x128, 256x256...) to get the desired result? And what is largest size of sprite in GameStudio? Is it 512x512? Thanks for your consideration 
|
|
|
Re: Old school 2D sprites
[Re: Enix]
#395669
02/26/12 12:21
02/26/12 12:21
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
Expert
|
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
you can load any size of sprite into A8 to usemy_sprite as a header and bmap and others as subs, you need to create a STRUCT.
typedef struct {
BMAP* bitmap;
int x_size;
int y_size;
int animation_frames;
char* filename;
} SPRITES;
SPRITES* my_sprite;
my_sprite.bitmap = bmap_create...
..etc...
all you need to do is calculate the animation frames with bmap_width/height and animation_frame count. To show the Sprites, you´ve different solutions: 1.) Using a new created sprite as 3D Entity, and use it as target map for the Oldschool bitmap 2.) in a 2D game, you better use PANELS and the window functions to animate it ^^
Last edited by Espér; 02/26/12 12:26.
|
|
|
Re: Old school 2D sprites
[Re: Espér]
#395672
02/26/12 14:23
02/26/12 14:23
|
Joined: Feb 2012
Posts: 9
Enix
OP
Newbie
|
OP
Newbie
Joined: Feb 2012
Posts: 9
|
Ok, so there is no something like this for sprites: c_move (me, vector(2 * time_step, 0, 0), nullvector, GLIDE); ent_animate(me, "walk", walk_percentage, ANM_CYCLE); but it can be if I try to simulate a sprite through 3d model by not using Z axis. I suppose that`s what you mean by "Using a new created sprite as 3D Entity, and use it as target map for the Oldschool bitmap"? Would be interesting to see how it works. I`ll try that. Sound easy but could be some geometric problems, ha? We`ll see. For the panels, I thought of that but I`m not sure if panels has collisions? Or other properties needed for proper handling. And for STRUCT, I think it will be like that at the end of the story. Good old structure for good oldies. Anyway, thanks for the clarification, mein freund  At least I know from where I can begin. It`s very overwhelming at the begining.
|
|
|
Re: Old school 2D sprites
[Re: Espér]
#395742
02/27/12 00:02
02/27/12 00:02
|
Joined: Jun 2004
Posts: 2,234 Wisconsin USA
FoxHound
Expert
|
Expert
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
|
If you want to make a 2d game your best bet is panels. Sprites don't animate and using a model with shiviting u. v. Points will be annoying and getting the collision detection to work the way a 2d game would work is also a lot of head aches. I went thru a lot of these problems recently in my 2d game and went from flat 3d to Panels only. Happy I did.
--------------------- There is no signature here.
QUIT LOOKING FOR ONE!
|
|
|
Re: Old school 2D sprites
[Re: FoxHound]
#395745
02/27/12 06:13
02/27/12 06:13
|
Joined: Feb 2012
Posts: 9
Enix
OP
Newbie
|
OP
Newbie
Joined: Feb 2012
Posts: 9
|
If you want to make a 2d game your best bet is panels. Sprites don't animate and using a model with shiviting u. v. Points will be annoying and getting the collision detection to work the way a 2d game would work is also a lot of head aches. I went thru a lot of these problems recently in my 2d game and went from flat 3d to Panels only. Happy I did. Ok, but I`m not sure how to do the collision detection with panels? Can you give me some idea please?
|
|
|
Re: Old school 2D sprites
[Re: Enix]
#395814
02/27/12 21:27
02/27/12 21:27
|
Joined: Jun 2004
Posts: 2,234 Wisconsin USA
FoxHound
Expert
|
Expert
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
|
Creat a strict with a panel as a member. Include stuff in the strict to tell things such as passable objects like clouds and background objects and how it can collide. Such as hitting a wall to the die but come from the top you can fall through it. Now set uP an array and have every object on the screen in that array. Now when you move your panel with your collisN detection functioniN check that panel with every Panel in the level to see if any of it's x or y positiOn plusThe size of the panel. This may seem Complicated and it is. But start small and build up. Also the 2.5d option is much easier.
Ps. Typing with an iPhone is annoying.
--------------------- There is no signature here.
QUIT LOOKING FOR ONE!
|
|
|
Re: Old school 2D sprites
[Re: FoxHound]
#395821
02/27/12 22:56
02/27/12 22:56
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
Alternatively, don't use panels at all and only work with a 2dimensional array (f.i. 0 is no tile, a positive value is a solid block, a negative value is a walkable) and then use draw_quad to draw appropriate bitmaps. Example:
BMAP* bmap_tile[7]; #define SIZE_X 13 #define SIZE_Y 20 var field[SIZE_X][SIZE_Y]; var tile_size = 32; ... for(i = 0; i < SIZE_X; i++) { for(j = 0; j < SIZE_Y; j++) { if(field[i][j] > 0) draw_quad(bmap_tile[field[i][j]-1],vector(i*tile_size,j*tile_size,0),NULL,NULL,NULL,NULL,100,0); } }
The bitmap array "bmap_tile" contains your tile images. You can easily perform collision detection by checking the "field" array, when your player at position i,j, check field[i+1][j] to see if you can go right etc.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|