-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
123 lines (101 loc) · 2.89 KB
/
main.c
File metadata and controls
123 lines (101 loc) · 2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#define MapScale 10
#include "raylib.h"
#include "raymath.h"
Texture2D TextBoxCharacter;
Model Map;
int GameState = 0;
float Banim;
bool Banimating;
bool Debug = false;
void IntBattle();
int Transition = 0;
float Alpha;
#include "Movement.c"
#include "Map.c"
#include "OverworldMap.c"
#include "Camera.c"
#include "TalkingToPeople.c"
#include "Nonpc.c"
#include "Player.c"
#include "Render.c"
#include "Battle System.c"
void DrawTransition(){
switch(Transition){
case 1:
BeginMode2D(dcamera);
Alpha+=GetFrameTime()*4000;
DrawRectangle(0, Alpha, GetScreenWidth(), GetScreenHeight(), BLACK);
EndMode2D();
if(Alpha > 0){
Transition = 2;
}
break;
case 2:
BeginMode2D(dcamera);
Alpha+=GetFrameTime()*4000;
DrawRectangle(0, Alpha, GetScreenWidth(), GetScreenHeight(), BLACK);
EndMode2D();
if(GameState == 1){GameState = 0;}
else{
GameState = 1;
Banimating = true;
Banim = -700;
P1H = 0.0f;
P2H = 0.0f;
BDN = 0;
}
Transition = 3;
break;
case 3:
BeginMode2D(dcamera);
Alpha+=GetFrameTime()*2200;
DrawRectangle(0, Alpha, GetScreenWidth(), GetScreenHeight(), BLACK);
EndMode2D();
if(Alpha > GetScreenHeight()*2){
Transition = 0;
Alpha = 0-GetScreenHeight();
}
break;
}
}
int main() {
intai();
const int screenWidth = 1200;
const int screenHeight = 720;
IntDCamera();
InitAudioDevice();
Music music = LoadMusicStream("Assets/MainTheme.mp3");
PlayMusicStream(music);
SetConfigFlags(FLAG_MSAA_4X_HINT || FLAG_VSYNC_HINT);
//SetTargetFPS(60);
InitWindow(screenWidth, screenHeight, "RPG Game");
SetWindowSize(GetMonitorWidth(GetCurrentMonitor()*2), GetMonitorHeight(GetCurrentMonitor()*2));
ToggleFullscreen();
HideCursor();
CameraInt();
IntTextures();
target = LoadRenderTexture(GetScreenWidth(), GetScreenHeight());
SwitchMap(1);
while (!WindowShouldClose())
{
UpdateMusicStream(music);
switch (GameState){
case 0:
Nonpc();
PlayerMovement();
RenderScene();
CameraUpdate();
break;
case 1:
BeginDrawing();
BattleUpdate();
RenderBattle();
break;
}
DrawTransition();
EndDrawing();
}
UnloadTextures();
CloseWindow();
return 0;
}