Jump to content

  • Log In with Google      Sign In   
  • Create Account


2d sprite animation


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
13 replies to this topic

#1 Makoy   Members   -  Reputation: 126

Like
Likes
Like

Posted 26 October 2003 - 07:14 PM

Hello guys can anybody give me a good links for animating 2d sprite? I''m planing to work on a 2d non api rpg game. but before that, I would like to do some research on that topic. Your help will be greatly appreciated.

Sponsor:

#2 Impossible   Members   -  Reputation: 134

Like
Likes
Like

Posted 26 October 2003 - 09:02 PM

Non-API? If it''s for Windows (or any modern OS on a PC), you''re gonna have to use some sort of API, even if it''s just the GDI.

A decent 2D Game programming tutorial is at 2dgame-tutorial.com. It''s DirectDraw7 specific, but a lot of stuff is pretty generic.

Sprite animation is pretty simple, basically you have a bunch frames in one image file, and you draw the correct part of that file for your current frame.

#3 RuneLancer   Members   -  Reputation: 253

Like
Likes
Like

Posted 27 October 2003 - 03:53 AM

Non-API? You at least need some way of drawing to the screen...

That aside, it should be no different than any API-based game...

#4 Spudder   Members   -  Reputation: 385

Like
Likes
Like

Posted 27 October 2003 - 09:20 AM

Animating sprites isn''t too hard when you actualy think about it and plan out how you want to code it, if you going the class based approach (assuming C++ here) then you would have an array of images which make up the sprite - one image per frame, some variables to store information about the sprite like the number of frames and the number of the currently active frame as well as the sprites posiiton on the screen (the last frame you drew). Now when you want to draw your sprite all you need to do is increment your frame counter and draw the corresponding sprite frame to the screen.



#5 Makoy   Members   -  Reputation: 126

Like
Likes
Like

Posted 27 October 2003 - 06:06 PM

I''m starting on a non API type game.How''s it possible to create a frame animation? Let us say in C++ and how is it possible to insert an image over a source? Can you guys give me an insight?


#6 Impossible   Members   -  Reputation: 134

Like
Likes
Like

Posted 27 October 2003 - 06:54 PM

quote:
Original post by Makoy
I''m starting on a non API type game.

What is a non-API type game?

#7 Makoy   Members   -  Reputation: 126

Like
Likes
Like

Posted 27 October 2003 - 07:30 PM

Non API game is a game that doesnt use direct x gls etc.


#8 a2ps   Members   -  Reputation: 139

Like
Likes
Like

Posted 27 October 2003 - 08:01 PM

well, it has to use somethin'', or else how would you do any drawing, for example? even if its only the winapi it has to use some kind of api.

#9 Dalik   Members   -  Reputation: 122

Like
Likes
Like

Posted 27 October 2003 - 08:24 PM

My guess is that he is writing to the hardware, or he could use windows to make his window but he wont be using a graphic api.

I dont understand why its hard for some of you to understand. Many people are making there own software rasterizer(sp?)

#10 Impossible   Members   -  Reputation: 134

Like
Likes
Like

Posted 28 October 2003 - 12:27 PM

quote:
Original post by Dalik
My guess is that he is writing to the hardware, or he could use windows to make his window but he wont be using a graphic api.


If he''s doing a PC game on Windows or Linux he can''t write directly to the hardware without writing a driver or doing some kind of extremely clever hack. Now, if it''s a GBA game writing to the hardware would make sense. Even if he''s using Windows to make his Window he''s still using the Win32 API and the GDI. I assume by "non-API" he means he''s not using the OpenGL or DirectDraw\3D but is using the GDI.


#11 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 28 October 2003 - 03:43 PM

Guys! I''m just asking a simple animation! I mean how should I do that? Is it possible on C++ Classes or Structure? If so? How''s it done?

#12 Impossible   Members   -  Reputation: 134

Like
Likes
Like

Posted 28 October 2003 - 05:21 PM

quote:
Original post by Anonymous Poster
Guys! I''m just asking a simple animation! I mean how should I do that? Is it possible on C++ Classes or Structure? If so? How''s it done?

What do you want??? exact code? Of course it''s possible with a class and there are different ways you can organie it.

#13 Makoy   Members   -  Reputation: 126

Like
Likes
Like

Posted 29 October 2003 - 02:03 PM

from Impossible
What do you want??? exact code? Of course it''s possible with a class and there are different ways you can organie it.


yeah I''m having trouble embeding the bitmaps to the source code.
Can you at least give me an insight on how it is done. If you can give me a sample source cod, that''ll greatly appreciated.

#14 Impossible   Members   -  Reputation: 134

Like
Likes
Like

Posted 29 October 2003 - 09:50 PM

quote:
Original post by Makoy
from Impossible
What do you want??? exact code? Of course it's possible with a class and there are different ways you can organie it.


yeah I'm having trouble embeding the bitmaps to the source code.
Can you at least give me an insight on how it is done. If you can give me a sample source cod, that'll greatly appreciated.

Well, you continue to just say "non-API" so no one knows exactly what platform you're coding for or how you're planning on getting graphics on the screen. But there are bitmap loading articles hrere and here. When it comes to actually drawing the articles use direct draw and opengl respectively. If you're using the GDI you probably want to use "LoadBitmap" along with "BitBlt" this explains it decently. Beyond those I can't really help you without knowing the platform you're coding for. If you're using something old or closer to the metal, like writing a mode 13h dos program, the same principles apply, although you have to blit the bitmap data yourself by copying the image data to the video memory pointer.

[edited by - impossible on October 30, 2003 4:51:05 AM]




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS