View Single Post
Old 06-20-2008, 10:33 AM   #10 (permalink)
jackluo923
Senior Zuner
 
jackluo923's Avatar
 
Join Date: Dec 2007
Location: Greater Vancouver BC
Posts: 1,275
Reputation: 122
Send a message via MSN to jackluo923
Default

OK.. I definetly need some help if its not too much to ask.

1) I looked into the code for the RaycasterX engine.
in Game1.cs at line 130 or so, there's this line of code

Code:
			//add some sprites to the level
            sprites.Add(new Sprite(new Vector2(3.5f, 3.5f), Content.Load<Texture2D>("Sprites/devil")));
"So you need to store each animation frame in a seperate Texture2D and cycle through them... its a bit different than using a spritesheet." - quote from in above post.

By storing each animation frame in a sepearate Texture2d and cycle through them, do you mean by the below code?

Say if I have 2 frames in a character animation, I would use something like the code below to cycle through the animations.

[code] //add some sprites to the level
sprites.Add(new Sprite(new Vector2(3.5f, 3.5f), Content.Load<Texture2D>("Sprites/devil")));
//remove some sprites to the level
sprites.Add(new Sprite(new Vector2(3.5f, 3.5f), Content.Load<Texture2D>("Sprites/devil")));
//add some sprites to the level
sprites.Add(new Sprite(new Vector2(3.5f, 3.5f), Content.Load<Texture2D>("Sprites/devilCOPY")));
//remove some sprites to the level
sprites.Add(new Sprite(new Vector2(3.5f, 3.5f), Content.Load<Texture2D>("Sprites/devilCOPY")));
//repeat line 132 - 136[code]

I'm not sure if this is the correct way to do it because this is only a educated guess.

Is there an alternative way to load animated sprites such as modifying the code and use the sprite sheet which you used for your running man game?

Jack
Thanks
__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.

Last edited by jackluo923 : 06-20-2008 at 10:38 AM.




jackluo923 is offline   Reply With Quote