Animated Characters

Forum for J2ME mobile games related topics including programming doubts, books and other resources for J2ME game development

Animated Characters

Postby Gaurav » Thu Oct 26, 2006 7:00 pm

I have just started reading about the J2ME base mobile games and the first question which comes into my mind is how to provide the animation to the characters like walking man, moving the arm etc..... Please give some pointers to me from where I can get this information
Regards,
Gaurav Vashishth
Gaurav
 
Posts: 3
Joined: Thu Oct 26, 2006 6:55 pm

Postby DevelopmentTeam » Fri Oct 27, 2006 5:39 am

The animation for objects can be given in sprites. Please take a look at sprite in MIDP2. The images should be in continuous frames and a sprite can be constructed from that images. Just reading about Sprite, Layermanager and GameCanvas will give you some idea.
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Postby silvercoder » Fri Oct 27, 2006 10:51 am

import javax.microedition.lcdui.Sprite;
import javax.microedition.lcdui.Graphics;

class player {
Sprite sprite = null;
Graphics g;
public player() {
sprite = new Sprite ( Image.createImage(fileName), frmaeWidth , frameHeight);
sprite.setFrame(currentFrame); // u can change the frame according to your sequence
sprite.setPosition(x, y); // Will set the current frame postion
sprite.paint(g); // this will paint what the current frame is
}
}
silvercoder
 
Posts: 37
Joined: Fri Sep 29, 2006 12:02 pm

Postby DevelopmentTeam » Fri Oct 27, 2006 11:03 am

And here is a sample images

Image
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Postby DevelopmentTeam » Fri Oct 27, 2006 11:05 am

This images contains the walking frames and the dieath frames for the object.
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Postby Gaurav » Mon Oct 30, 2006 7:15 am

If I have guessed right, It means that for generating any kind of animation like street fighting, I need to store all the sequences of the character in the PNG format????

Is there any techinques in which we can load the image in pieces like arms, legs, mouth etc..and then using physics to provide the animation
Regards,
Gaurav Vashishth
Gaurav
 
Posts: 3
Joined: Thu Oct 26, 2006 6:55 pm

Postby DevelopmentTeam » Mon Oct 30, 2006 1:47 pm

ofcourse you can include you physics in your code. There in no such pre-defined APIs for that. :-)
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Postby Gaurav » Mon Oct 30, 2006 4:03 pm

Are you aware of any good articles related to this topic ..

I have one more question: the games like Bike Racing use the frames or the animation using physics. I was just wondering how mnay frames I need to include for these type of games :-)

Please Suggest
Regards,
Gaurav Vashishth
Gaurav
 
Posts: 3
Joined: Thu Oct 26, 2006 6:55 pm

Postby DevelopmentTeam » Tue Oct 31, 2006 4:13 am

if you are thinking about the perfect 3d ones, they are not in frames. But they design a 3d object and render. Some phones which have 3dAPI support these type of games. Also some companies have writen their own rendering engines. For example I have a Need for speed game in Nokia 6600. If you are really interested in putting physics you can see some samples here or contact this person.

http://www.geocities.com/bpj1138/weekendracer/
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Re: Animated Characters

Postby pokarnitin » Sat Jan 12, 2008 6:10 am

Hi Garurav,
In context of question u have asked that, whether there is any tool available which will load arm, leg, face etc separately and create a animation out of it.
so yes there are tools available for j2me game development, which does similar things, One of them is Motion Wlder (http://www.motionwelder.com/Solutions.html ).
Have a look at this. Image.
It comes along with API, to read an animation created by Motion Welder.
Do let me knw, if i can help you more on this :-)
pokarnitin
 
Posts: 7
Joined: Sat Jan 12, 2008 5:37 am

Re: Animated Characters

Postby DevelopmentTeam » Mon Jan 14, 2008 6:44 am

Hi pokarnitin,

That was a wonderful tool, we'll definitely try that soon. :) Thanks for your post and welcome to this forum.
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Re: Animated Characters

Postby mobdev » Tue Jan 29, 2008 6:45 am

Hi everybody !

I am new to mobile game development. I just tried motion welder tool , I was wondering if it is possible to animate numbers which are dynamically generated. I mean .. I need a matrix of animated numbers which will be generated dynamically ( by the game server ) . Can we use motion welder for that purpose.

Thanks
mobdev
 
Posts: 3
Joined: Tue Jan 29, 2008 6:39 am

Re: Animated Characters

Postby pokarnitin » Tue Jan 29, 2008 8:50 am

Hi mobdev,
I am wondering what kind of animation you are trying to play.
If you are developing game like Casino where you want to animate numbers you can develop animation for all the digit(0-9) and play it all together by create different players(no of players = no of animation to be played at a time.... if 4 digit animation , then 5 player).
Or else if your are creating a sudoku kind of game, where numbers animates even in such case, you just need to create 10 different animation and play it by creating player and setting x,y of that animation.
I would like to give you example of Dice Game on which i was working sometime ago, where user need to throw two dice
There i had created 6 animations for 6 faces, where dice had a rolling effect created using few image clips.
But it was very monotonous, hence we gave each animation some orientation. (say at 20,40,60). So my total animation were 18(3x6).
This way i manipulated it.
It would be great if you tell me little bit more about your animation.

-Nitin
pokarnitin
 
Posts: 7
Joined: Sat Jan 12, 2008 5:37 am

Re: Animated Characters

Postby mobdev » Tue Jan 29, 2008 9:14 am

Thanks for the prompt reply.

My animation consists of a card (a 5*5 matrix of numbers , say) and the number on cards will vary on the basis of number called from the server( a casino game in fact) . Now I need to generate the card in runtime. Should I use digits (0-9) to construct the number required and display on the matrix grid ? How to go about it?
mobdev
 
Posts: 3
Joined: Tue Jan 29, 2008 6:39 am

Re: Animated Characters

Postby pokarnitin » Tue Jan 29, 2008 11:15 am

Yes, you need to create number using animation of individual digits, and programmatically group it together.
Just a tips on this:
Suppose you want to create animation of a digit. But your requirement is that all digit should be in two colors(say blue and green) in such case, you need not create 9x2(blue and green), instead create animation using single color, and while loading animation pass image of different color.
Please let me know, if your doubt is solved, or need little bit detailed explanation, or else i m interpreting it wrongly.

Thanks
Nitin
pokarnitin
 
Posts: 7
Joined: Sat Jan 12, 2008 5:37 am

Next

Return to J2ME Games

Who is online

Users browsing this forum: No registered users and 3 guests

cron