-
Notifications
You must be signed in to change notification settings - Fork 0
/
fightanimations.h
56 lines (50 loc) · 1.85 KB
/
fightanimations.h
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
#include <string.h>
#include <SDL.h>
#include "rects.h"
#include "prop.h"
void reloadFightOverlay(){
SDL_BlitSurface(gFightScreen, NULL, gScreenSurface, NULL);
SDL_BlitSurface(gBossSprite, &fromBossRect, gScreenSurface, &bossFightRect);
SDL_BlitSurface(gSpriteFight, NULL, gScreenSurface, &spriteFightRect);
SDL_BlitSurface(gTextChoice, NULL, gScreenSurface, &interfaceRect);
//SDL_BlitSurface(gHPbar, NULL, gScreenSurface, &playerHPbarRect);
//SDL_BlitSurface(gHPbar, NULL, gScreenSurface, &enemyHPbarRect);
SDL_UpdateWindowSurface(gWindow);
}
void reloadFightOverlayAttack(){
SDL_BlitSurface(gFightScreen, NULL, gScreenSurface, NULL);
SDL_BlitSurface(gBossSprite, &fromBossRect, gScreenSurface, &bossFightRect);
SDL_BlitSurface(gSpriteFight, NULL, gScreenSurface, &spriteFightRect);
SDL_BlitSurface(gTextAtk, NULL, gScreenSurface, &interfaceRect);
//SDL_BlitSurface(gHPBar, NULL, gScreenSurface, &playerHPbarRect);
//SDL_BlitSurface(gHPEBar, NULL, gScreenSurface, &enemyHPbarRect);
SDL_UpdateWindowSurface(gWindow);
}
void reloadFightOverlaySpell(){
SDL_BlitSurface(gFightScreen, NULL, gScreenSurface, NULL);
SDL_BlitSurface(gBossSprite, &fromBossRect, gScreenSurface, &bossFightRect);
SDL_BlitSurface(gSpriteFight, NULL, gScreenSurface, &spriteFightRect);
SDL_BlitSurface(gTextSpz, NULL, gScreenSurface, &interfaceRect);
SDL_BlitSurface(gFireBall, NULL, gScreenSurface, &fireBallRect);
SDL_UpdateWindowSurface(gWindow);
}
void playerAttackMove(){
for(int i=0; i<100; i++){
spriteFightRect.x+=2;
reloadFightOverlayAttack();
SDL_Delay(5);
}
spriteFightRect.x=spriteFightRect.x-200;
reloadFightOverlay();
SDL_UpdateWindowSurface(gWindow);
}
void playerSpell(){
for(int i=0; i<100; i++){
fireBallRect.x+=2;
reloadFightOverlaySpell();
SDL_Delay(5);
}
fireBallRect.x=fireBallRect.x-200;
reloadFightOverlay();
SDL_UpdateWindowSurface(gWindow);
}