2 Replies - 285 Views - Last Post: 02 May 2013 - 06:23 AM Rate Topic: -----

#1 s3lfik  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 18-April 13

equipment sprite logic question

Posted 02 May 2013 - 02:32 AM

Hello my dear dreamincoders =) I need some help in solving a sprite question =) I'm making a very simple RPG game and find out i don't know how to show the elements of equipment on my charcter. I want to make an equipment set of 5 items(helmet, gloves, boots, top and bottom) and don't really can imagine how to combine them all on my character. Going to make the different sets so items of different sets should combine and been showed right ... Any ideas or exact answers? maybe any opensource examples? i hope i don't ask anything against the rules

I want to appologize for my english, that is bad enough to make troubles understanding me , but i'm trying =) Thanks for patience =)

Is This A Good Question/Topic? 0
  • +

Replies To: equipment sprite logic question

#2 aaron1178  Icon User is offline

  • Dovakiin, Dragonborn
  • member icon

Reputation: 169
  • View blog
  • Posts: 1,303
  • Joined: 22-October 08

Re: equipment sprite logic question

Posted 02 May 2013 - 03:51 AM

Hi,

What I would do is have 5 sprites for each thing my 2D sprite would wear. So something like this:

  • Helmet
  • Shirt
  • Pants
  • Boots


And I would have my character class have 5 different sprite for each item. I would also have a rectangle that defines the sprites boundaries and draw all the sprites, with respect to the actual positions returned from the rectangles. So a class something like bellow:

class mMySpriteCharacter
{
    public:
      void RenderSprites(); //Called in the scene render loop
      void ChangeHelmetSprite( sprite * pSprite ); //The new sprite of the helmet

    private:
      Sprite Helmet,
             Shirt,
             Pants,
             Boots;
};



I've also taken the liberty to search on google for articles relating to this is someway or another. As bellow:



Hope it helps :)

Aaron1178
Was This Post Helpful? 1
  • +
  • -

#3 s3lfik  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 18-April 13

Re: equipment sprite logic question

Posted 02 May 2013 - 06:23 AM

So .. i should make five different sprites .. it makes sense =) thanks a lot =) so now i can get back to have some work on it =)
That was VERY useful.. really thanks a lot =)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1