From: Skullheadx <704277@pdsb.net> Date: Tue, 12 Jul 2022 00:41:58 +0000 (-0400) Subject: particles X-Git-Url: http://git.skullheadx.com/nixos/pfp.webp?a=commitdiff_plain;h=8b4d27bc95be9c8f700fa945da0cc91b33d99dbb;p=Pygame-Jam.git particles --- diff --git a/Actors.py b/Actors.py index 27634b0..49dd46a 100644 --- a/Actors.py +++ b/Actors.py @@ -2,6 +2,7 @@ from datetime import datetime, timedelta import threading from Setup import * +from Particle import Dust # from PhysicsBody import PhysicsBody from Block import Block @@ -19,6 +20,7 @@ class Actor: terminal_velocity = 15 invincibility_time = 150 + def __init__(self, pos, collision_layer, collision_mask): self.position = pg.Vector2(pos) self.velocity = pg.Vector2(0, 0) @@ -39,7 +41,7 @@ class Actor: self.jumping = False self.coyote_time = datetime.utcnow() self.hold_jump = datetime.utcnow() - self.stun_time = 750 + self.stun_time = 1000 self.attacked = False self.invincibility_frames = 0 @@ -47,6 +49,7 @@ class Actor: if self.jumping: if self.on_ground: self.jumping = False + Dust(pg.Vector2(self.get_collision_rect().midbottom) + pg.Vector2(-16,-15), 32, 0) self.stun_time -= delta self.stun_time = max(self.stun_time, 0) diff --git a/Assets/enemy/Goon_Run.gif b/Assets/enemy/Goon_Run.gif new file mode 100644 index 0000000..3377434 Binary files /dev/null and b/Assets/enemy/Goon_Run.gif differ diff --git a/Assets/enemy/Pirate_Goon.png b/Assets/enemy/Pirate_Goon.png new file mode 100644 index 0000000..6211e08 Binary files /dev/null and b/Assets/enemy/Pirate_Goon.png differ diff --git a/Assets/skeleton/skele_ATTAK.gif b/Assets/skeleton/skele_ATTAK.gif new file mode 100644 index 0000000..21f3bf3 Binary files /dev/null and b/Assets/skeleton/skele_ATTAK.gif differ diff --git a/Enemy.py b/Enemy.py index 045d777..4b43d64 100644 --- a/Enemy.py +++ b/Enemy.py @@ -2,18 +2,18 @@ from argparse import Action from Setup import * from Player import Player from Actors import Actor -from Weapon import Melee - +from Weapon import Sword +from Particle import Dust class Enemy(Actor): speed = Actor.speed * 0.33 jump_strength = Actor.jump_strength * 0.5 colour = (235, 64, 52) friction = 0.9 - run_gif = Image.open("Assets/skeleton/skeleton_run.gif") + run_gif = Image.open("Assets/enemy/Goon_Run.gif") run_frames = [] for i in range(run_gif.n_frames): - run_frames.append(pg.transform.scale(pil_to_game(get_gif_frame(run_gif, i)), (125, 125))) + run_frames.append(pg.transform.scale(pil_to_game(get_gif_frame(run_gif, i)), (180, 180))) def __init__(self, pos, collision_layer, collision_mask): super().__init__(pos, collision_layer, collision_mask) @@ -26,8 +26,8 @@ class Enemy(Actor): # self.health = 0 # for debugging without getting killed - self.weapon = Melee(self.position, (-Melee.width / 2 + 7, Melee.height / 2 + self.height / 3 - 8), - (-5, Melee.height), self.width, -1, -10) + self.weapon = Sword(self.position, (0, 0), self.width, -1) + self.buffer = [] @@ -40,11 +40,10 @@ class Enemy(Actor): def update(self, delta, target=None): super().update(delta) if not self.attacked and target is not None and self.stun_time == 0: - # print('a') - self.follow_target(target) - # if random.random() < 2/fps and not self.weapon.attacking and self.weapon.get_collision_rect().colliderect(target.get_collision_rect()): - # target.attack(self, self.weapon, self.direction) - # print('attack') + self.follow_target(target, stop_dist=target.width/2+self.weapon.width) + if not target.attacked and get_display_rect(self.weapon.get_collision_rect()).colliderect( + get_display_rect(target.get_collision_rect())): + target.attack(self, self.weapon, self.direction) # Deals with collision and applying velocity self.position, self.velocity = self.move_and_collide(self.position.copy(), self.velocity.copy(), delta) @@ -59,11 +58,12 @@ class Enemy(Actor): frame = math.floor(self.current_frame) if self.velocity.x > 0: self.display = self.run_frames[math.floor(frame)] - self.display_offsets["enemy"] = pg.Vector2(-40, -35) + self.display_offsets["enemy"] = pg.Vector2(-60, -35) elif self.velocity.x <= 0: self.display = pg.transform.flip(self.run_frames[math.floor(frame)], True, False) - self.display_offsets["enemy"] = pg.Vector2(-55, -35) - + self.display_offsets["enemy"] = pg.Vector2(-60, -35) + if frame % 4 == 0 and self.on_ground: + Dust(pg.Vector2(self.get_collision_rect().midbottom) + pg.Vector2(math.copysign(1, self.velocity.x) * -self.width/2,-15), 16, self.direction) self.current_frame = (self.current_frame + 0.5) % self.run_gif.n_frames @@ -78,7 +78,7 @@ class Enemy(Actor): def draw(self, surf): self.weapon.draw(surf) - # super(Enemy, self).draw(surf) + super(Enemy, self).draw(surf) surf.blit(self.display, get_display_rect(self.get_collision_rect()).topleft + self.display_offsets["enemy"]) # for b in self.buffer: diff --git a/Game.py b/Game.py index 3eaee72..a5ff4f3 100644 --- a/Game.py +++ b/Game.py @@ -67,6 +67,9 @@ class Game: self.collision_layer["enemy"].remove(enemy) self.collision_layer["body"].add(self.enemies[i]) + for particle in particles: + particle.update(delta) + self.world.update(delta) self.fade = self.Transition.fade @@ -90,6 +93,10 @@ class Game: pass; self.world.draw(surf) + + for particle in particles: + particle.draw(surf) + for enemy in self.enemies: enemy.draw(surf) diff --git a/Levels/Level5.txt b/Levels/Level5.txt index 0e324a7..1695f1c 100644 --- a/Levels/Level5.txt +++ b/Levels/Level5.txt @@ -1,6 +1,6 @@ -none|none|none|none|none|none|none|none|none|none|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world -1250.0,750.0|1200.0,750.0|1350.0,750.0|1350.0,700.0|1450.0,750.0|1450.0,700.0|1450.0,650.0|1450.0,600.0|1450.0,550.0|1250.0,700.0|50.0,800.0|100.0,800.0|150.0,800.0|200.0,800.0|250.0,800.0|300.0,800.0|350.0,800.0|400.0,800.0|450.0,800.0|500.0,800.0|550.0,800.0|600.0,800.0|650.0,800.0|700.0,800.0|750.0,800.0|800.0,800.0|850.0,800.0|900.0,800.0|950.0,800.0|1000.0,800.0|1050.0,800.0|1100.0,800.0|1150.0,800.0|1200.0,800.0|1250.0,800.0|1300.0,800.0|1350.0,800.0|1400.0,800.0|1450.0,800.0|1500.0,800.0|1550.0,800.0|1600.0,800.0|1650.0,800.0|1700.0,800.0|1750.0,800.0|1800.0,800.0|1850.0,800.0|1900.0,800.0|1950.0,800.0|2000.0,800.0|2050.0,800.0|2100.0,800.0|2150.0,850.0|2100.0,850.0|2050.0,850.0|2000.0,850.0|1950.0,850.0|1900.0,850.0|1850.0,850.0|1800.0,850.0|1750.0,850.0|1700.0,850.0|1650.0,850.0|1600.0,850.0|1550.0,850.0|1500.0,850.0|1450.0,850.0|1400.0,850.0|1350.0,850.0|1300.0,850.0|1250.0,850.0|1200.0,850.0|1150.0,850.0|1100.0,850.0|1050.0,850.0|1000.0,850.0|950.0,850.0|900.0,850.0|850.0,850.0|800.0,850.0|750.0,850.0|700.0,850.0|650.0,850.0|600.0,850.0|550.0,850.0|500.0,850.0|450.0,850.0|400.0,850.0|350.0,850.0|300.0,850.0|250.0,850.0|200.0,850.0|150.0,850.0|100.0,850.0|50.0,850.0|0.0,850.0|0.0,800.0|0.0,750.0|0.0,700.0|0.0,650.0|0.0,600.0|0.0,550.0|0.0,400.0|0.0,350.0|0.0,300.0|0.0,250.0|0.0,200.0|0.0,150.0|0.0,100.0|0.0,50.0|0.0,0.0|2200.0,850.0|2200.0,800.0|2200.0,750.0|2200.0,700.0|2200.0,650.0|2200.0,600.0|2150.0,400.0|2200.0,200.0|2200.0,150.0|2200.0,100.0|2200.0,50.0|2200.0,0.0|2150.0,0.0|2150.0,50.0|2150.0,100.0|2150.0,150.0|2150.0,200.0|2150.0,250.0|2150.0,350.0|2150.0,300.0|2200.0,250.0|2200.0,300.0|2200.0,350.0|2200.0,400.0|2200.0,550.0|2150.0,550.0|2150.0,600.0|2150.0,650.0|2150.0,700.0|2150.0,750.0|2150.0,800.0|300.0,600.0|0.0,450.0|2200.0,450.0|2150.0,450.0|2150.0,500.0|2200.0,500.0|0.0,500.0|1900.0,550.0|1900.0,600.0|1900.0,650.0|1900.0,700.0|1900.0,750.0|2050.0,700.0 -GOLDCOIN|BRONZECOIN|PEDESTAL|INTERDIMENSIONALPOWDER|PILLAR_|PILLAR_|PILLAR_|PILLAR_|PILLAR_|SILVERCOIN|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLAYER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|ENEMY +none|none|none|none|none|none|none|none|none|none|none|none|none|none|none|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world +1250.0,750.0|1200.0,750.0|1350.0,750.0|1350.0,700.0|1450.0,750.0|1450.0,700.0|1450.0,650.0|1450.0,600.0|1450.0,550.0|1250.0,700.0|1900.0,550.0|1900.0,600.0|1900.0,650.0|1900.0,700.0|1900.0,750.0|50.0,800.0|100.0,800.0|150.0,800.0|200.0,800.0|250.0,800.0|300.0,800.0|350.0,800.0|400.0,800.0|450.0,800.0|500.0,800.0|550.0,800.0|600.0,800.0|650.0,800.0|700.0,800.0|750.0,800.0|800.0,800.0|850.0,800.0|900.0,800.0|950.0,800.0|1000.0,800.0|1050.0,800.0|1100.0,800.0|1150.0,800.0|1200.0,800.0|1250.0,800.0|1300.0,800.0|1350.0,800.0|1400.0,800.0|1450.0,800.0|1500.0,800.0|1550.0,800.0|1600.0,800.0|1650.0,800.0|1700.0,800.0|1750.0,800.0|1800.0,800.0|1850.0,800.0|1900.0,800.0|1950.0,800.0|2000.0,800.0|2050.0,800.0|2100.0,800.0|2150.0,850.0|2100.0,850.0|2050.0,850.0|2000.0,850.0|1950.0,850.0|1900.0,850.0|1850.0,850.0|1800.0,850.0|1750.0,850.0|1700.0,850.0|1650.0,850.0|1600.0,850.0|1550.0,850.0|1500.0,850.0|1450.0,850.0|1400.0,850.0|1350.0,850.0|1300.0,850.0|1250.0,850.0|1200.0,850.0|1150.0,850.0|1100.0,850.0|1050.0,850.0|1000.0,850.0|950.0,850.0|900.0,850.0|850.0,850.0|800.0,850.0|750.0,850.0|700.0,850.0|650.0,850.0|600.0,850.0|550.0,850.0|500.0,850.0|450.0,850.0|400.0,850.0|350.0,850.0|300.0,850.0|250.0,850.0|200.0,850.0|150.0,850.0|100.0,850.0|50.0,850.0|0.0,850.0|0.0,800.0|0.0,750.0|0.0,700.0|0.0,650.0|0.0,600.0|0.0,550.0|0.0,400.0|0.0,350.0|0.0,300.0|0.0,250.0|0.0,200.0|0.0,150.0|0.0,100.0|0.0,50.0|0.0,0.0|2200.0,850.0|2200.0,800.0|2200.0,750.0|2200.0,700.0|2200.0,650.0|2200.0,600.0|2150.0,400.0|2200.0,200.0|2200.0,150.0|2200.0,100.0|2200.0,50.0|2200.0,0.0|2150.0,0.0|2150.0,50.0|2150.0,100.0|2150.0,150.0|2150.0,200.0|2150.0,250.0|2150.0,350.0|2150.0,300.0|2200.0,250.0|2200.0,300.0|2200.0,350.0|2200.0,400.0|2200.0,550.0|2150.0,550.0|2150.0,600.0|2150.0,650.0|2150.0,700.0|2150.0,750.0|2150.0,800.0|300.0,600.0|0.0,450.0|2200.0,450.0|2150.0,450.0|2150.0,500.0|2200.0,500.0|0.0,500.0|2050.0,700.0 +GOLDCOIN|BRONZECOIN|PEDESTAL|INTERDIMENSIONALPOWDER|PILLAR_|PILLAR_|PILLAR_|PILLAR_|PILLAR_|SILVERCOIN|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLAYER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|PLACEHOLDER|ENEMY diff --git a/Particle.py b/Particle.py new file mode 100644 index 0000000..ba16287 --- /dev/null +++ b/Particle.py @@ -0,0 +1,28 @@ +import Setup +from Setup import * + +class Dust: + dust_gif = Image.open("Assets/player/DUSTCLOUD.gif") + dust_frames = [] + for i in range(dust_gif.n_frames): + dust_frames.append(pil_to_game(get_gif_frame(dust_gif, i))) + + def __init__(self, pos, dust_size, direction): + self.position = pg.Vector2(pos) + self.dust_size = dust_size + self.velocity = pg.Vector2(0,0) + self.direction = -direction + self.current_frame = 0 + self.display = self.dust_frames[math.floor(self.current_frame)] + Setup.particles.append(self) + + def update(self, delta): + self.position += self.velocity + self.velocity = pg.Vector2(self.direction * delta / 64, -self.current_frame * delta / 256) + self.display = pg.transform.scale(self.dust_frames[math.floor(self.current_frame)], (self.dust_size, self.dust_size)) + self.current_frame = (self.current_frame + 0.25) + if math.floor(self.current_frame) >= self.dust_gif.n_frames-1: + del Setup.particles[Setup.particles.index(self)] + + def draw(self, surf): + surf.blit(self.display, get_display_point(self.position)) diff --git a/Player.py b/Player.py index d945aaf..a104df1 100644 --- a/Player.py +++ b/Player.py @@ -7,9 +7,11 @@ from Actors import Actor from datetime import datetime, timedelta from Potion import Potion from Weapon import Sword +from Particle import Dust class Player(Actor): + friction = 0.2 scale = 100 factor = 640 / scale crop = pg.Rect(179, 169, 170, 401) @@ -81,6 +83,12 @@ class Player(Actor): # print('a') def update(self, delta): + + if self.attacked: + self.friction = 0.9 + else: + self.friction = 0.2 + super().update(delta) # Get and handle input @@ -155,6 +163,9 @@ class Player(Actor): self.display = pg.transform.flip(self.run_frames[math.floor(frame)], True, False) self.display_offsets["player"] = pg.Vector2(-65, -35) + if frame % 2 == 0 and self.on_ground: + Dust(pg.Vector2(self.get_collision_rect().midbottom) + pg.Vector2(math.copysign(1, self.velocity.x) * -self.width/2,-15), 16, self.direction) + self.current_frame = (self.current_frame + 0.5) % self.run_gif.n_frames if self.state == "RUN": @@ -255,7 +266,11 @@ class Player(Actor): surf.blit(pg.transform.flip(self.weapon.img, False, True), get_display_rect(self.get_collision_rect()).topleft + pg.Vector2(0, 55) + self.display_offsets["weapon"]) - surf.blit(self.display, get_display_rect(self.get_collision_rect()).topleft + self.display_offsets["player"]) + + a = get_display_rect(self.get_collision_rect()) + b = a.topleft + self.display_offsets["player"] + if pg.Rect(b,a.size).colliderect(screen_rect): + surf.blit(self.display, b) # # for b in self.buffer: # pg.draw.rect(surf,(0,0,255),get_display_rect(b),3) diff --git a/Setup.py b/Setup.py index a0bc8d8..c6ed120 100644 --- a/Setup.py +++ b/Setup.py @@ -13,6 +13,8 @@ SCREEN_WIDTH, SCREEN_HEIGHT = 1080, 640 dimensions = (SCREEN_WIDTH, SCREEN_HEIGHT) center = pg.Vector2(dimensions) / 2 +screen_rect = pg.Rect(0,0,SCREEN_WIDTH,SCREEN_HEIGHT) + pg.display.set_caption("Jam") # icon = pg.transform.scale(pg.image.load("logo.ico"), (32, 32)) # pg.display.set_icon(icon) @@ -59,3 +61,5 @@ def pil_to_game(img): def get_gif_frame(img, frame): img.seek(frame) return img.convert(FORMAT) + +particles = [] diff --git a/main.py b/main.py index eda163a..eb0597e 100644 --- a/main.py +++ b/main.py @@ -51,5 +51,6 @@ while is_running: pg.display.update() delta = clock.tick(fps) + print(clock.get_fps()) pg.quit()