Skip to content

Commit 2d7cf6d

Browse files
committed
got animate2d working with cc mario png
1 parent a7480f9 commit 2d7cf6d

6 files changed

Lines changed: 7 additions & 6 deletions

File tree

assets/mario.png

251 KB
Loading

example2

558 KB
Binary file not shown.

examples/TEST_Animate2D.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,16 @@
4545
4646
Author
4747
~~~~~~
48-
David Barr, aka javidx9, ©OneLoneCoder 2019, 2020, 2021, 2022
48+
David Barr, aka javidx9, OneLoneCoder 2019, 2020, 2021, 2022
4949
5050
*/
5151

5252

5353
#define OLC_PGE_APPLICATION
54+
#define OLC_IGNORE_VEC2D
55+
#include "utilities/olcUTIL_Animate2D.h"
5456
#include "olcPixelGameEngine.h"
5557

56-
#include "utilities/olcUTIL_Animate2D.h"
5758

5859
class TEST_Animate2D : public olc::PixelGameEngine
5960
{
@@ -108,7 +109,7 @@ class TEST_Animate2D : public olc::PixelGameEngine
108109
// For this appliaction I have a single image that contains
109110
// 28x2 unique characters, each character contains 8 animations of 3
110111
// frames each. Each frame is 26x36 pixels
111-
gfxAll.Load("./assets/MegaSprite1.png");
112+
gfxAll.Load("./assets/mario.png");
112113

113114
// Thats A LOT of individual graphics, but they all follow a similar pattern
114115
// because the asset was created usefully (take note certain popular asset creators)

olcExampleProgram.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Example : public olc::PixelGameEngine
3030
int main()
3131
{
3232
Example demo;
33-
if (demo.Construct(256, 240, 4, 4))
33+
if (demo.Construct(256, 240, 64, 64, false, false, false))
3434
demo.Start();
3535

3636
return 0;

test_animate

648 KB
Binary file not shown.

utilities/olcUTIL_Animate2D.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
4949
Author
5050
~~~~~~
51-
David Barr, aka javidx9, ©OneLoneCoder 2019, 2020, 2021, 2022, 2023, 2024
51+
David Barr, aka javidx9, OneLoneCoder 2019, 2020, 2021, 2022, 2023, 2024
5252
5353
5454
Versions
@@ -58,8 +58,8 @@
5858

5959
#pragma once
6060

61-
#include "olcPixelGameEngine.h"
6261
#include "utilities/olcUTIL_Geometry2D.h"
62+
#include "olcPixelGameEngine.h"
6363
#include <unordered_map>
6464

6565
namespace olc::utils::Animate2D

0 commit comments

Comments
 (0)