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
6d171542
authored
May 01, 2024
by
grlabu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete loader.c
parent
88f44526
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
36 deletions
Source/loader.c
Source/loader.c
deleted
100644 → 0
View file @
88f44526
#include "Header.h"
int
SaveGame
(
char
*
file
,
Player
*
p
,
int
enemiesDefeated
)
{
FILE
*
fh
;
fh
=
fopen
(
file
,
"w"
);
if
(
fh
==
NULL
)
{
fprintf
(
stderr
,
"Error opening save file!
\n
"
);
return
1
;
}
fprintf
(
fh
,
"%d %d %d
\n
%d"
,
p
->
health
,
p
->
attack
,
p
->
potionCount
,
enemiesDefeated
);
fclose
(
fh
);
return
0
;
}
void
LoadGame
(
char
*
file
,
Player
*
p
,
int
*
enemies
)
{
FILE
*
fh
;
fh
=
fopen
(
file
,
"r"
);
if
(
fh
==
NULL
)
{
fprintf
(
stderr
,
"Failed to open file %s
\n
"
,
file
);
exit
(
1
);
}
fscanf
(
fh
,
"%d %d %d"
,
&
p
->
health
,
&
p
->
attack
,
&
p
->
potionCount
);
fscanf
(
fh
,
"%d"
,
enemies
);
fclose
(
fh
);
}
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