Skip to content

Commit 000cf05

Browse files
add preview
1 parent 362612e commit 000cf05

File tree

4 files changed

+15
-42
lines changed

4 files changed

+15
-42
lines changed

AndroidDodgeGame.NativeActivity/graphics.cpp

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -351,34 +351,3 @@ void draw_mesh(graphics_context* context, const mesh* mesh, const shader* shader
351351
set_pass(context, shader);
352352
draw_mesh(context, mesh, matrix);
353353
}
354-
355-
void draw_mesh(graphics_context* context, const mesh* mesh, const shader* shader, matrix_trail_32* trail, const float4x4& matrix, int maxlength)
356-
{
357-
trail->head++;
358-
359-
if (trail->head >= 32)
360-
{
361-
trail->head = 0;
362-
}
363-
364-
trail->matrices[trail->head] = matrix;
365-
366-
trail->length++;
367-
trail->length = trail->length > 32 ? 32 : trail->length;
368-
trail->length = trail->length > maxlength ? maxlength : trail->length;
369-
370-
if (trail->length <= 0)
371-
{
372-
return;
373-
}
374-
375-
for (int i = 0, j = trail->head; i < trail->length; ++i, --j)
376-
{
377-
if (j < 0)
378-
{
379-
j = 31;
380-
}
381-
382-
draw_mesh(context, mesh, shader, trail->matrices[j]);
383-
}
384-
}

AndroidDodgeGame.NativeActivity/graphics.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@ struct shader_source
2828
const char* source;
2929
};
3030

31-
struct matrix_trail_32
32-
{
33-
float4x4 matrices[32];
34-
int head;
35-
int length;
36-
};
37-
3831
struct graphics_context
3932
{
4033
const mesh* active_mesh = nullptr;
@@ -73,6 +66,4 @@ void draw_mesh(graphics_context* context, const mesh* mesh, const float4x4& matr
7366

7467
void draw_mesh(graphics_context* context, const mesh* mesh, const shader* shader);
7568

76-
void draw_mesh(graphics_context* context, const mesh* mesh, const shader* shader, const float4x4& matrix);
77-
78-
void draw_mesh(graphics_context* context, const mesh* mesh, const shader* shader, matrix_trail_32* trail, const float4x4& matrix, int maxlength);
69+
void draw_mesh(graphics_context* context, const mesh* mesh, const shader* shader, const float4x4& matrix);

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
1-
# AndroidDodgeGame
1+
# Android Dodge Game
2+
23
A C++ native activity game for android.
4+
5+
![Preview](T_Preview.gif?raw=true "Preview")
6+
7+
## Gameplay
8+
- The player traverses on an endless track trying to gain as much speed as possible.
9+
- Blue pads increase speed by 1.
10+
- Red pads decrease speed by 10%.
11+
- Touch the screen to switch lanes.
12+
13+
## Requirements
14+
- GL ES 3.0 or higher.
15+
- Android API level 25 or higher (7.1 Nougat).

T_Preview.gif

5.88 MB
Loading

0 commit comments

Comments
 (0)