diff --git a/Makefile b/Makefile index 4f57573..55a3334 100644 --- a/Makefile +++ b/Makefile @@ -32,9 +32,9 @@ SOURCES := source source/minizip DATA := data INCLUDES := include -APP_TITLE := Test -APP_DESCRIPTION := ??? -APP_AUTHOR := Davideesk +APP_TITLE := Minicraft 3DS +APP_DESCRIPTION := Minicraft was originally created by Markus "Notch" Perrson. This was ported to the 3DS by Davideesk. +APP_AUTHOR := Davideesk and andre111 #--------------------------------------------------------------------------------- # options for code generation diff --git a/data/icons2.png b/data/icons2.png index 37a97d6..2527908 100644 Binary files a/data/icons2.png and b/data/icons2.png differ diff --git a/icon.png b/icon.png new file mode 100644 index 0000000..ce37e18 Binary files /dev/null and b/icon.png differ diff --git a/source/Globals.c b/source/Globals.c index e52d4a7..7955f5d 100644 --- a/source/Globals.c +++ b/source/Globals.c @@ -385,6 +385,7 @@ bool ItemVsEntity(Item* item, Entity* e, int dir){ return true; case ENTITY_MAGIC_PILLAR: + playSound(snd_monsterHurt); removeEntityFromList(e, e->level, &eManager); return true; } break; @@ -402,6 +403,7 @@ bool ItemVsEntity(Item* item, Entity* e, int dir){ return true; case ENTITY_MAGIC_PILLAR: + playSound(snd_monsterHurt); removeEntityFromList(e, e->level, &eManager); return true; } break; @@ -418,6 +420,7 @@ bool ItemVsEntity(Item* item, Entity* e, int dir){ return true; case ENTITY_MAGIC_PILLAR: + playSound(snd_monsterHurt); removeEntityFromList(e, e->level, &eManager); return true; } break; @@ -1277,7 +1280,7 @@ void tickEntity(Entity* e){ if (e->hurtTime > 0) e->hurtTime--; e->dragon.animTimer++; - if(e->dragon.animTimer>=20) { + if(e->dragon.animTimer>=4*4) { e->dragon.animTimer = 0; } @@ -1285,8 +1288,8 @@ void tickEntity(Entity* e){ if (e->dragon.attackDelay > 0) { e->dragon.attackDelay--; if (e->dragon.attackDelay <= 0) { - e->wizard.attackType = rand()%2; - e->wizard.attackTime = 121; + e->dragon.attackType = rand()%2; + e->dragon.attackTime = 121; } return; } diff --git a/source/Item.h b/source/Item.h index 490dbc7..228b0ec 100644 --- a/source/Item.h +++ b/source/Item.h @@ -66,7 +66,6 @@ #define ITEM_BONE 68 #define ITEM_DUNGEON_KEY 69 #define ITEM_WIZARD_SUMMON 70 -//TODO - implement icon #define ITEM_DRAGON_EGG 71 #define ITEM_DRAGON_SCALE 72 diff --git a/source/Render.c b/source/Render.c index dabb407..2e6666a 100644 --- a/source/Render.c +++ b/source/Render.c @@ -1133,19 +1133,18 @@ void renderEntity(Entity* e, int x, int y) { renderr(x, y, 200, 152, 0, e->spark.age * 0.0349); break; case ENTITY_DRAGON: - //TODO - render dragon(maybe with flying animation) switch (e->dragon.dir) { case 0: // down - render32(x - 16, y - 16, 0+(e->dragon.animTimer<10 ? 0 : 64), 256, 2); + render32(x - 16, y - 16, 0+(e->dragon.animTimer/4 * 32), 256, 2); break; case 1: // up - render32(x - 16, y - 16, 0+(e->dragon.animTimer<10 ? 0 : 64), 256, 0); + render32(x - 16, y - 16, 0+(e->dragon.animTimer/4 * 32), 256, 0); break; case 2: // left - render32(x - 16, y - 16, 0+(e->dragon.animTimer<10 ? 0 : 64), 288, 1); + render32(x - 16, y - 16, 0+(e->dragon.animTimer/4 * 32), 288, 1); break; case 3: // right - render32(x - 16, y - 16, 0+(e->dragon.animTimer<10 ? 0 : 64), 288, 0); + render32(x - 16, y - 16, 0+(e->dragon.animTimer/4 * 32), 288, 0); break; } break; @@ -1486,6 +1485,12 @@ void renderItemIcon(int itemID, int countLevel, int x, int y) { case ITEM_WIZARD_SUMMON: render(x, y, 152, 160, 0); break; + case ITEM_DRAGON_EGG: + render(x, y, 160, 160, 0); + break; + case ITEM_DRAGON_SCALE: + render(x, y, 168, 160, 0); + break; case TOOL_BUCKET: render(x, y, 200 + countLevel * 8, 144, 0); break; diff --git a/source/Sound.c b/source/Sound.c index 9474c6d..288fb4d 100644 --- a/source/Sound.c +++ b/source/Sound.c @@ -20,6 +20,11 @@ void playMusic(Sound snd){ csndPlaySound(10, SOUND_FORMAT_16BIT | SOUND_REPEAT, 44100, 1, 0, snd.buffer, snd.buffer, snd.size); } +void stopMusic() { + CSND_SetPlayState(8, 0); + CSND_SetPlayState(10, 0); +} + void updateMusic(int lvl, int time) { switch(lvl) { case 0: diff --git a/source/Sound.h b/source/Sound.h index 22aeffa..42dc00a 100644 --- a/source/Sound.h +++ b/source/Sound.h @@ -15,6 +15,7 @@ void playSound(Sound snd); void playMusic(Sound snd); void updateMusic(int lvl, int time); +void stopMusic(); void loadSounds(); void freeSounds(); diff --git a/source/main.c b/source/main.c index eb1432e..ebe5ede 100644 --- a/source/main.c +++ b/source/main.c @@ -296,6 +296,8 @@ int main() { sf2d_swapbuffers(); } + + stopMusic(); freeRecipes();