Skip to content

Commit e3925e2

Browse files
committed
Prepared for v.0.3
1 parent 82def1a commit e3925e2

File tree

9 files changed

+30
-22
lines changed

9 files changed

+30
-22
lines changed

Game/units_data.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<life value="100" />
99
<speed value="100" />
1010
<damage value="10" />
11-
<vision value="10" />
11+
<vision value="180" />
1212
<range value="80" />
1313
<cool value="1" />
1414
<up>
@@ -179,7 +179,7 @@
179179
<life value="100" />
180180
<speed value="100" />
181181
<damage value="100" />
182-
<vision value="100" />
182+
<vision value="200" />
183183
<range value="100" />
184184
<cool value="1" />
185185

@@ -350,8 +350,8 @@
350350
<life value="100" />
351351
<speed value="100" />
352352
<damage value="10" />
353-
<vision value="10" />
354-
<range value="80" />
353+
<vision value="180" />
354+
<range value="50" />
355355
<cool value="1" />
356356
<up>
357357
<rect x="5" y="68"/>

Motor2D/Motor2D.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<UseDebugLibraries>false</UseDebugLibraries>
2828
<WholeProgramOptimization>true</WholeProgramOptimization>
2929
<CharacterSet>MultiByte</CharacterSet>
30-
<PlatformToolset>v140</PlatformToolset>
30+
<PlatformToolset>v120</PlatformToolset>
3131
</PropertyGroup>
3232
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
3333
<ImportGroup Label="ExtensionSettings">

Motor2D/TacticalAI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ bool TacticalAI::Update(float dt)
4444
{
4545
if ((*unit_f)->state != UNIT_DIE && (*unit_e)->state != UNIT_DIE)
4646
{
47-
if ((*unit_f)->GetPosition().DistanceTo((*unit_e)->GetPosition()) <= DETECTION_RANGE)
47+
if ((*unit_f)->GetPosition().DistanceTo((*unit_e)->GetPosition()) <= (*unit_f)->vision)
4848
{
4949
if ((*unit_f)->GetTarget() == NULL)
5050
{

Motor2D/TacticalAI.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
#include <map>
77
#include <queue>
88

9-
#define DETECTION_RANGE 100
10-
119
enum UNIT_EVENT{
1210
END_MOVING,
1311
ATTACKED,

Motor2D/Unit.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void Unit::Update(float dt)
112112
App->render->DrawCircle(logic_pos.x, logic_pos.y, range, 0, 0, 255, 255, true);
113113

114114
//Paint vision range
115-
App->render->DrawCircle(logic_pos.x, logic_pos.y, DETECTION_RANGE, 0, 255, 255, 255, true);
115+
App->render->DrawCircle(logic_pos.x, logic_pos.y, vision, 0, 255, 255, 255, true);
116116
}
117117

118118

@@ -170,9 +170,7 @@ void Unit::Draw()
170170

171171
}
172172

173-
//Animations
174-
sprite.rect.x = current_animation->getCurrentFrame().x;
175-
sprite.rect.y = current_animation->getCurrentFrame().y;
173+
176174

177175
App->render->Blit(&sprite);
178176

@@ -522,6 +520,10 @@ void Unit::SetAnimation()
522520
current_animation = &a_up;
523521
}
524522
}
523+
524+
//Animations
525+
sprite.rect.x = current_animation->getCurrentFrame().x;
526+
sprite.rect.y = current_animation->getCurrentFrame().y;
525527

526528
}
527529

Motor2D/Unit.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ class Unit : public Entity
7474

7575
uint speed;
7676
uint damage;
77-
uint vision;
7877
uint range;
7978
uint cool;
8079
vector<iPoint> path;
@@ -87,7 +86,7 @@ class Unit : public Entity
8786
public:
8887
UNIT_STATE state;
8988
queue<UNIT_EVENT> events;
90-
89+
uint vision;
9190

9291

9392
bool is_enemy;

Motor2D/j1App.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ void j1App::FinishUpdate()
236236
static char title[256];
237237
sprintf_s(title, 256, "Av.FPS: %.2f Last Frame Ms: %u Last sec frames: %i Last dt: %.3f Time since startup: %.3f Frame Count: %lu ",
238238
avg_fps, last_frame_ms, frames_on_last_update, dt, seconds_since_startup, frame_count);
239-
//App->win->SetTitle(title);
239+
App->win->SetTitle(title);
240240

241241
if(capped_ms > 0 && last_frame_ms < capped_ms)
242242
{

Motor2D/j1Render.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ bool j1Render::Update(float dt)
111111
App->input->GetMouseWorld(mouse_x, mouse_y);
112112
iPoint pos = App->map->WorldToMap(mouse_x, mouse_y, 2);
113113
sprintf_s(title, 256, "Tile x: %i y: %i", pos.x, pos.y);
114-
App->win->SetTitle(title);
114+
//App->win->SetTitle(title);
115115

116116
return true;
117117
}

README.txt

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11

2-
- M: Create marine
3-
- G: Create ghost
4-
- Spacebar: return cam initial position
5-
- F1 (pressed): Show/hide colliders
6-
- P: pause the game
7-
- N: Create enemy marine
2+
***************************************
3+
** **
4+
** STARCRAFT COMMANDOS **
5+
** **
6+
***************************************
7+
8+
- CONTROLS:
9+
10+
* M: Create marine
11+
* N: Create enemy marine
12+
* G: Create ghost
13+
* F: Create firebat
14+
* Spacebar: return cam initial position
15+
* F1 : Debug mode
16+
* P: pause the game

0 commit comments

Comments
 (0)