Debian Codegraph @

src/brain_bounce.cpp

raw
1 #ifdef HAVE_CONFIG_H
2 #include <config.h>
3 #endif
4
5 #include "brain.h"
6 #include "live_sprites_manager.h"
7 #include "live_screen.h"
8 #include "gfx_sprites.h"
9 #include "gfx.h" /* GFX_RES_W -> a little off-screen ?? */
10
11 void bounce_brain(int h)
12 {
13 if (spr[h].y > (playy-k[getpic(h)].box.bottom))
14 {
15 spr[h].my -= (spr[h].my * 2);
16 }
17
18 if (spr[h].x > (GFX_RES_W -k[getpic(h)].box.right))
19 {
20 spr[h].mx -= (spr[h].mx * 2);
21 }
22
23 if (spr[h].y < 0)
24 {
25 spr[h].my -= (spr[h].my * 2);
26 }
27
28
29 if (spr[h].x < 0)
30 {
31 spr[h].mx -= (spr[h].mx * 2);
32 }
33
34
35 spr[h].x += spr[h].mx;
36 spr[h].y += spr[h].my;
37 }