diff --git a/.DS_Store b/.DS_Store index 513f252..815a23f 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index d5aac31..2c7c6d5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ *.3dsx -*.smdh *.elf build diff --git a/Flappy3DS.smdh b/Flappy3DS.smdh new file mode 100644 index 0000000..cf896c7 Binary files /dev/null and b/Flappy3DS.smdh differ diff --git a/source/Sprite.cpp b/source/Sprite.cpp index e93a471..a1ea7bd 100644 --- a/source/Sprite.cpp +++ b/source/Sprite.cpp @@ -94,4 +94,13 @@ C2D_Sprite* Sprite::getSpr() { void Sprite::setSpr(C2D_Sprite* newSpr) { this->spr = *newSpr; +} + +void Sprite::copy(Sprite* other) { + memcpy(&other->x, &this->x, sizeof(this->x)); + memcpy(&other->y, &this->y, sizeof(this->y)); + memcpy(&other->width, &this->width, sizeof(this->width)); + memcpy(&other->height, &this->height, sizeof(this->height)); + memcpy(other->center, this->center, sizeof(this->center)); + memcpy(&other->spr, &this->spr, sizeof(this->spr)); } \ No newline at end of file diff --git a/source/Sprite.hpp b/source/Sprite.hpp index e406422..6222d1b 100644 --- a/source/Sprite.hpp +++ b/source/Sprite.hpp @@ -33,6 +33,8 @@ public: void setSpr(C2D_Sprite* newSpr); + void copy(Sprite* other); + C2D_Sprite spr; private: diff --git a/source/main.cpp b/source/main.cpp index c0780c4..c138b36 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -119,9 +119,6 @@ int main(int argc, char* argv[]) { if (kDown & KEY_START) break; // break in order to return to hbmenu - if (kDown & KEY_SELECT) - main(0, 0); // reset - // gravity calcs v += a;