Skip to content

Commit 329686d

Browse files
committed
Update sample code and apk file.
1 parent d1610f0 commit 329686d

File tree

7 files changed

+19
-8
lines changed

7 files changed

+19
-8
lines changed

Samples/Apk/Sample.apk

4.24 MB
Binary file not shown.

Samples/SuperLittleRed/Android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
jcenter()
77
}
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:4.0.0'
9+
classpath 'com.android.tools.build:gradle:4.1.2'
1010
// NOTE: Do not place your application dependencies here; they belong
1111
}
1212

Samples/SuperLittleRed/Code/EnemyAI.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static void DoEnemyAI(Scheduler* scheduler, float deltaSeconds)
213213
//----------------------------------------------------------------------------------------------------------------------
214214

215215

216-
static inline void RandomSmallEnemey(Enemy* enemy)
216+
static inline void RandomSmallEnemy(Enemy* enemy)
217217
{
218218
if (AMath_Random() < 0.2f)
219219
{
@@ -283,7 +283,7 @@ static Enemy* CreateWood(float x)
283283

284284
enemy->type = EnemyType_Wood;
285285

286-
RandomSmallEnemey(enemy);
286+
RandomSmallEnemy(enemy);
287287

288288
return enemy;
289289
}

Samples/SuperLittleRed/Code/HUD.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,13 @@ static bool CostPower(int cost)
325325
{
326326
AHero->roundEnergy -= cost;
327327
isCostEnergy = true;
328-
float scaleY = (float) AHero->roundEnergy / (float) AGameData->maxEnergy;
328+
329+
if (AHero->roundEnergy > AGameData->maxEnergy)
330+
{
331+
AHero->roundEnergy = AGameData->maxEnergy;
332+
}
333+
334+
float scaleY = (float) AHero->roundEnergy / (float) AGameData->maxEnergy;
329335

330336
ATweenTool->AddScaleY (scaleY, 0.2f)
331337
->SetRelative (false)
@@ -359,6 +365,7 @@ static bool CostPower(int cost)
359365
AFont->SetString(text, "Weak");
360366
}
361367

368+
AFont_SetTextColor(text, AColor_Make(0.81f, 0.78f, 0.75f,1.0f));
362369
ATool->FlyTextOnHero(text, 0.1f, 4.0f);
363370

364371
return false;

Samples/SuperLittleRed/Code/Hero.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ static bool OnStandMessage(Array(InputTouch*)* touchArr)
851851
float deltaX = fabsf(touchDownX - touch->x);
852852
float deltaY = touchDownY - touch->y;
853853

854-
if (deltaY > 0.05f && deltaX < 0.1f)
854+
if (deltaY > 0.08f && deltaX < 0.1f)
855855
{
856856
if
857857
(
@@ -1107,15 +1107,15 @@ static void OnActionOver(SkeletonAnimationPlayer* player)
11071107

11081108
AHero->hitFloor->loop = 1;
11091109
AComponent->Notify(AHero->component, HeroNotify_Dizzy, NULL);
1110+
1111+
AAudioTool->Play(AudioID_FallDown);
1112+
AVibrator->Vibrate(100);
11101113
}
11111114
else
11121115
{
11131116
// no power hit floor, release dizzy lock
11141117
isDizzyLocked = false;
11151118
}
1116-
1117-
AAudioTool->Play(AudioID_FallDown);
1118-
AVibrator->Vibrate(100);
11191119
break;
11201120
}
11211121

@@ -1558,6 +1558,7 @@ static void RoundScore()
15581558
char buff[12];
15591559
sprintf(buff, "+%d", score);
15601560
AFont->SetString(text, buff);
1561+
AFont_SetTextColor(text, AColor_Make(0.72f, 0.99f, 0.38f, 1.0f));
15611562
ATool->FlyTextOnHero(text, 0.045f, 3.0f);
15621563

15631564
AHero->roundEnergy += score;

Samples/SuperLittleRed/Code/UI.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include <stdio.h>
1818

19+
#include "Engine/Application/Platform/Vibrator.h"
1920
#include "Engine/Toolkit/Platform/Log.h"
2021
#include "Engine/Extension/DrawAtlas.h"
2122
#include "Engine/Application/Input.h"
@@ -561,6 +562,7 @@ static bool OnMessage(Component* component, void* sender, int subject, void* ext
561562
AHUD->DropStone();
562563
AFont->SetInt(AHUD->stoneText, --AGameData->stone);
563564
AAudioTool->Play(AudioID_ClickBtn);
565+
AVibrator->Vibrate(100);
564566
}
565567
else
566568
{
@@ -578,6 +580,7 @@ static bool OnMessage(Component* component, void* sender, int subject, void* ext
578580
AHUD->DropWood();
579581
AFont->SetInt(AHUD->woodText, --AGameData->wood);
580582
AAudioTool->Play(AudioID_ClickBtn);
583+
AVibrator->Vibrate(100);
581584
}
582585
else
583586
{
-3.53 MB
Binary file not shown.

0 commit comments

Comments
 (0)