Completely trash game but I might end my days soon so I push now
This commit is contained in:
@@ -287,6 +287,29 @@ void Refresh_Area(Rectangle area){
|
||||
}
|
||||
}
|
||||
}
|
||||
void Refresh_Player_Area(Rectangle area,Rectangle Hitbox){
|
||||
Sprite_32x32 sprite = ShipSprite1;
|
||||
Resize_Window(area);
|
||||
Write_Cmd(0x2C);
|
||||
Color color;
|
||||
for(int y= 0; y < area.Size.Height;y++){
|
||||
auto_screen_roloff(area,(Point){0,y});
|
||||
for(int x = 0; x < area.Size.Width+1;x++){
|
||||
if(y + area.Position.Y >= Hitbox.Position.Y
|
||||
&& y + area.Position.Y < Hitbox.Position.Y + Hitbox.Size.Height
|
||||
&& x + area.Position.X >= Hitbox.Position.X
|
||||
&& x + area.Position.X < Hitbox.Position.X + Hitbox.Size.Width){
|
||||
|
||||
Get_Color_From_Sprite(sprite,(Point){x-(Hitbox.Position.X - area.Position.X),y-(Hitbox.Position.Y-area.Position.Y)},&color);
|
||||
SendPixel(color.Red,color.Green,color.Blue);
|
||||
}else{
|
||||
//Get_Color_From_Background((Point){area.Position.X+x,(area.Position.Y+y)%SCREEN_HEIGHT},&color);
|
||||
//SendPixel(color.Red,color.Green,color.Blue);
|
||||
SendPixel(0,0,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void DrawPlayer(Player player, Rectangle areaToDraw){
|
||||
Sprite_32x32 sprite = ShipSprite1;
|
||||
Color color;
|
||||
@@ -307,6 +330,7 @@ void DrawPlayer(Player player, Rectangle areaToDraw){
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Draw_stars(){
|
||||
Write_Cmd(0x2C);
|
||||
for(int y = 0; y < SCREEN_HEIGHT;y++){
|
||||
|
||||
Reference in New Issue
Block a user