Skip to content

Commit

Permalink
Merge pull request #7 from sardap/v0.4.0
Browse files Browse the repository at this point in the history
V0.4.0
  • Loading branch information
sardap authored Mar 26, 2021
2 parents 5b71bf7 + 1c3ca91 commit 83ddfd8
Show file tree
Hide file tree
Showing 54 changed files with 830 additions and 302 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ assets/weapons/*.png
assets/misc/*.png
assets/obstacles/*.png
assets/game_intro/*.png
assets/title_screen/*.png

assets/out.png
__debug_bin
Expand All @@ -19,6 +20,7 @@ mus_edit/

backgrounds_out.png
objects_out.png
version.png

act/
.actrc
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@
"giwhale_air_0.h": "c",
"ready.h": "c",
"building3tileset.h": "c",
"tonc.h": "c"
"tonc.h": "c",
"player.h": "c",
"graphics.h": "c",
"enemybisuctdeath03.h": "c",
"anime.h": "c",
"enemybiscutufoidle00.h": "c"
},
"C_Cpp.errorSquiggles": "Disabled",
"cSpell.words": [
Expand Down
16 changes: 14 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@
"panel": "new"
}
},
{
"label": "build-assets",
"type": "shell",
"command": "docker run --rm -v ${PWD}:/app wgm-builder:latest assets",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "build-docker",
"type": "shell",
Expand All @@ -44,6 +57,5 @@
},
"problemMatcher": []
}

]
}
}
Binary file added assets/enemy/enemyBiscutUFODeath00.psd
Binary file not shown.
Binary file added assets/enemy/enemyBiscutUFODeath01.psd
Binary file not shown.
Binary file added assets/enemy/enemyBiscutUFODeath02.psd
Binary file not shown.
Binary file added assets/enemy/enemyBiscutUFODeath03.psd
Binary file not shown.
Binary file added assets/enemy/enemyBiscutUFODeath04.psd
Binary file not shown.
Binary file added assets/enemy/enemyBiscutUFODeath05.psd
Binary file not shown.
Binary file added assets/enemy/enemyBiscutUFOIdle00.psd
Binary file not shown.
Binary file added assets/enemy/enemyBiscutUFOIdle01.psd
Binary file not shown.
Binary file added assets/enemy/enemyBiscutUFOIdle02.psd
Binary file not shown.
Binary file added assets/enemy/enemyBisuctDeath00.psd
Binary file not shown.
Binary file added assets/enemy/enemyBisuctDeath01.psd
Binary file not shown.
Binary file added assets/enemy/enemyBisuctDeath02.psd
Binary file not shown.
Binary file added assets/enemy/enemyBisuctDeath03.psd
Binary file not shown.
Binary file added assets/enemy/enemyBullet00.psd
Binary file not shown.
Binary file removed assets/title_screen/tsBackgroundAgg.png
Binary file not shown.
Binary file removed assets/title_screen/tsBeach.png
Binary file not shown.
Binary file removed assets/title_screen/tsCity.png
Binary file not shown.
Binary file removed assets/title_screen/tsEmpty.png
Binary file not shown.
Binary file removed assets/title_screen/tsLava.png
Binary file not shown.
Binary file removed assets/title_screen/tsTitleText.png
Binary file not shown.
Binary file modified assets/title_screen/tsTitleText.psd
Binary file not shown.
Binary file removed assets/title_screen/tsWater.png
Binary file not shown.
18 changes: 18 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ COPY ./tools/colour-agg/*.go ./

RUN go build -o main .

############################################

FROM golang:latest as builder-builder

WORKDIR /app
Expand All @@ -20,6 +22,18 @@ RUN go build -o main .

##################################################

FROM golang:latest as version-img-gen-builder

WORKDIR /app
COPY ./tools/version-img-gen/go.mod .
COPY ./tools/version-img-gen/go.sum .
RUN go mod download

COPY ./tools/version-img-gen/*.go ./

RUN go build -o main .

##################################################
#Devkit pro image is out of date also deabain is fucked here for some reason
FROM devkitpro/devkitarm:latest as GBA-builder

Expand All @@ -34,6 +48,10 @@ COPY --from=colour-agg-builder /app/main /bin/colour-agg.exe
COPY --from=builder-builder /app/main /bin/builder
RUN chmod +x /bin/builder

#Copy version-img-gen-builder
COPY --from=version-img-gen-builder /app/main /bin/version-img-gen
RUN chmod +x /bin/version-img-gen

RUN mkdir /app

WORKDIR /app
Expand Down
2 changes: 1 addition & 1 deletion make_assets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ gen_png "./assets/title_screen"

OBJECTS="$OBJECTS $PWD/assets/text/lifeTitle.png "

# colour-agg.exe ./assets/objects_out.png $OBJECTS
version-img-gen ./assets/title_screen/tsTitleText.png

colour-agg.exe ./assets/title_screen/tsBackgroundAgg.png \
./assets/title_screen/tsEmpty.png \
Expand Down
Binary file added music/enemy_biscut_ufo_death_0.wav
Binary file not shown.
26 changes: 25 additions & 1 deletion source/anime.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <tonc.h>

void step_anime(
void step_anime_bad(
const unsigned int *anime[], int tile_len, int count,
int *cycle, int tile_idx)
{
Expand All @@ -21,3 +21,27 @@ void step_anime(
(*cycle) = count * 3;
}
}

bool step_anime(
int *cycle,
const unsigned int *anime[], int count,
int tile_idx, int tile_len)
{
//Copy current frame into tile mem
dma3_cpy(
&tile_mem[4][tile_idx],
anime[(*cycle)],
tile_len);

//Next frame
++(*cycle);

//Check if need to wrap cycle
if ((*cycle) >= count)
{
(*cycle) = 0;
return true;
}

return false;
}
15 changes: 11 additions & 4 deletions source/anime.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
#ifndef ANIME_H
#define ANIME_H

void step_anime(
const unsigned int *anime[], int tile_len, int count,
int *cycle, int tile_idx
);
#include <tonc.h>

void step_anime_bad(
const unsigned int *anime[], int tile_len, int count,
int *cycle, int tile_idx);

//Returns true when the anime is complete
bool step_anime(
int *cycle,
const unsigned int *anime[], int count,
int tile_idx, int tile_len);

#endif
42 changes: 26 additions & 16 deletions source/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@

#include "debug.h"
#include "numbers.h"
#include "ent.h"

static int _frame_count;
FIXED _scroll_x;
static int _score;
static int _score_att_start;
static int _score_ent_start;

static void nothing(void) {}

Expand Down Expand Up @@ -63,6 +64,24 @@ int gba_rand()
return qran();
}

void init_score()
{
_score = 0;
_score_ent_start = allocate_visual_ent(SCORE_DIGITS);

for (int i = 0; i < SCORE_DIGITS; i++)
{
_visual_ents[_score_ent_start + i].type = TYPE_VISUAL_SCORE;

_visual_ents[_score_ent_start + i].x = int2fx(8 * i);
_visual_ents[_score_ent_start + i].y = 0;

_visual_ents[_score_ent_start + i].att.attr0 = ATTR0_SQUARE | ATTR0_8BPP;
_visual_ents[_score_ent_start + i].att.attr1 = ATTR1_SIZE_8x8;
_visual_ents[_score_ent_start + i].att.attr2 = ATTR2_PALBANK(0) | ATTR2_PRIO(0) | ATTR2_ID(get_number_tile_start());
}
}

static void update_score()
{
int i_score = _score;
Expand All @@ -87,27 +106,18 @@ static void update_score()
offset = 0;
}

obj_set_attr(&_obj_buffer[_score_att_start + i],
ATTR0_SQUARE | ATTR0_8BPP, ATTR1_SIZE_8x8,
ATTR2_PALBANK(0) | ATTR2_PRIO(0) | ATTR2_ID(get_number_tile_start() + offset * 2));

obj_set_pos(&_obj_buffer[_score_att_start + i], 8 * i, 0);

i_score /= 10;
}
}

void init_score()
{
_score = 0;
_score_att_start = allocate_ent(SCORE_DIGITS);

update_score();
_visual_ents[_score_ent_start + i].att.attr2 =
ATTR2_PALBANK(0) |
ATTR2_PRIO(0) |
ATTR2_ID(get_number_tile_start() + offset * 2);
}
}

void clear_score()
{
free_ent(_score_att_start, SCORE_DIGITS);
free_visual_ent(_score_ent_start, SCORE_DIGITS);
}

void add_score(int x)
Expand Down
Loading

0 comments on commit 83ddfd8

Please sign in to comment.