Project update #1

Done on April 9, 2017 – First animation

AlpagosGame_01

This first update allowed me to set up the SDL in the project and use it to create a window and render textures. Additionally, I implemented a rough draft of an Animation class in the AlpagosEngine. This class references a SDL_Texture, which is the sprite sheet containing all the character’s animations, and clips it to render the right frame.

At this point the animation parameters were still hard coded directly in the class. As you can see this character’s idle animation is 6 frames long and each sprite has a size of 32×32 pixels. Also, in this first version the delta time was not even passed to the Update method.

void Animation::Update()
{
    m_Frame = (m_Frame + 1) % 6;
}

void Animation::Render(int x, int y, int width, int height)
{
    SDL_Rect clip = { m_Frame * 32, 0, 32, 32 };
    m_Texture.Render(x, y, width, height, &clip);
}

The Animation system will be massively improved as part of the next project update.

I’m temporarily using a sprite sheet which can be downloaded for free from the Unity Asset Store. Unity 2D Roguelike tutorial:
https://unity3d.com/learn/tutorials/projects/2d-roguelike-tutorial

Scavengers_SpriteSheet

Cheers.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s