Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
krkane
/
Rüütli Vaev
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
fa1fb5bd
authored
Mar 20, 2024
by
krkane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Main.c
parent
a4db2dba
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
13 deletions
Source/Main.c
Source/Main.c
View file @
fa1fb5bd
...
@@ -39,15 +39,19 @@ int main(void)
...
@@ -39,15 +39,19 @@ int main(void)
while
(
gameState
==
1
)
while
(
gameState
==
1
)
{
{
if
(
defeatedEnemies
<
NUM_HENCHMEN
)
int
moveResult
=
Move
(
defeatedEnemies
);
{
if
(
moveResult
==
-
10
)
{
// Player encountered a trap
handleTrap
(
&
player
);
continue
;
// Restart the loop, allowing the player to choose the path again
}
if
(
defeatedEnemies
<
NUM_HENCHMEN
)
{
Enemy
enemy
=
CreateEnemy
(
defeatedEnemies
);
Enemy
enemy
=
CreateEnemy
(
defeatedEnemies
);
printf
(
"
\n
Vastane tüübiga %s, %dHP ja rünnaku tugevusega"
printf
(
"
\n
Vastane tüübiga %s, %dHP ja rünnaku tugevusega"
" %d on loodud.
\n
"
,
enemy
.
type
,
enemy
.
health
,
enemy
.
attack
);
" %d on loodud.
\n
"
,
enemy
.
type
,
enemy
.
health
,
enemy
.
attack
);
gameState
=
fight
(
&
player
,
&
enemy
);
gameState
=
fight
(
&
player
,
&
enemy
);
}
}
else
{
else
{
// Generate the final boss
// Generate the final boss
FinalBoss
boss
=
CreateFinalBoss
(
defeatedEnemies
);
FinalBoss
boss
=
CreateFinalBoss
(
defeatedEnemies
);
printf
(
"
\n
Vastane tüübiga %s, %dHP ja rünnaku tugevusega"
printf
(
"
\n
Vastane tüübiga %s, %dHP ja rünnaku tugevusega"
...
@@ -55,19 +59,12 @@ int main(void)
...
@@ -55,19 +59,12 @@ int main(void)
gameState
=
bossFight
(
&
player
,
&
boss
);
gameState
=
bossFight
(
&
player
,
&
boss
);
}
}
if
(
gameState
==
0
)
if
(
gameState
==
0
)
{
{
return
0
;
return
0
;
}
}
defeatedEnemies
++
;
defeatedEnemies
++
;
levelUp
(
&
player
);
levelUp
(
&
player
);
gameState
=
Move
(
defeatedEnemies
);
if
(
gameState
==
0
)
{
return
0
;
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment