From: Skullheadx <704277@pdsb.net> Date: Mon, 11 Jul 2022 18:30:03 +0000 (-0400) Subject: new assets X-Git-Url: http://git.skullheadx.com/nixos/static/gitweb.css?a=commitdiff_plain;h=e7ac8cfee26e760feba72dae5d396dea34f78961;p=Pygame-Jam.git new assets --- diff --git a/Assets/SFX/Running_Sound_Effect.wav b/Assets/SFX/Running_Sound_Effect.wav index 8b80933..21a286c 100644 Binary files a/Assets/SFX/Running_Sound_Effect.wav and b/Assets/SFX/Running_Sound_Effect.wav differ diff --git a/Assets/world/blocks/STONEBRICK.png b/Assets/world/blocks/STONEBRICK.png new file mode 100644 index 0000000..b554eb6 Binary files /dev/null and b/Assets/world/blocks/STONEBRICK.png differ diff --git a/Assets/world/blocks/STONEDIRTCORNER.png b/Assets/world/blocks/STONEDIRTCORNER.png new file mode 100644 index 0000000..b89c27e Binary files /dev/null and b/Assets/world/blocks/STONEDIRTCORNER.png differ diff --git a/Assets/world/decor/INTERDIMENSIONALPOWDER.png b/Assets/world/decor/INTERDIMENSIONALPOWDER.png new file mode 100644 index 0000000..5e4f84f Binary files /dev/null and b/Assets/world/decor/INTERDIMENSIONALPOWDER.png differ diff --git a/Assets/world/decor/PEDESTAL.png b/Assets/world/decor/PEDESTAL.png new file mode 100644 index 0000000..9ff4930 Binary files /dev/null and b/Assets/world/decor/PEDESTAL.png differ diff --git a/Assets/world/decor/PILLAR_.png b/Assets/world/decor/PILLAR_.png new file mode 100644 index 0000000..b7041a3 Binary files /dev/null and b/Assets/world/decor/PILLAR_.png differ diff --git a/Function/Portal.py b/Function/Portal.py index 16f3b9d..feb4a05 100644 --- a/Function/Portal.py +++ b/Function/Portal.py @@ -4,6 +4,10 @@ from Function.createText import createText from Function.WorldCoords import * class Transition: + portal_gif = Image.open("Assets/world/decor/PORTAL.gif") + portal_frames = [] + for i in range(portal_gif.n_frames): + portal_frames.append(pg.transform.scale(pil_to_game(get_gif_frame(portal_gif, i)), (155, 155))) def __init__(self): self.height = 150 @@ -19,8 +23,11 @@ class Transition: self.fade = False + self.current_frame = 0 + def update(self): + self.current_frame = (self.current_frame + 1) % self.portal_gif.n_frames return; def draw(self, surf, playerPos, offset=(0,0)): @@ -31,7 +38,7 @@ class Transition: coords[1] += self.portalYAnim a = (((offsetX-self.width/2) + coords[0], offsetY + coords[1]), (offsetX+coords[0], offsetY-self.height/2+coords[1]), (offsetX+self.width/2 + coords[0], offsetY+coords[1]), (offsetX + coords[0], offsetY+self.height/2 + coords[1])) - portal_rect = (a[0][0], a[1][1], a[2][0], a[3][1]) + portal_rect = pg.Rect(a[0][0], a[1][1], a[2][0], a[3][1]) # print(a[0][0], a[1][1], a[2][0], a[3][1]) # print(playerPos[0], playerPos[1]) @@ -42,7 +49,9 @@ class Transition: if pressed[pg.K_e] or pressed[pg.K_RETURN]: self.fade = True; - pg.draw.polygon(surf, (107, 18, 158), a) + # pg.draw.polygon(surf, (107, 18, 158), a) + + surf.blit(self.portal_frames[math.floor(self.current_frame)], pg.Vector2(portal_rect.topleft)+pg.Vector2(-37,5)) if(self.portalYAnim <= -25 and self.down == False): self.down = True diff --git a/LevelCreator.py b/LevelCreator.py index e49021a..2897f41 100644 --- a/LevelCreator.py +++ b/LevelCreator.py @@ -262,7 +262,7 @@ class LevelCreator: math.ceil(self.zoom * 5)) display_img = EditorBlock.textures[self.textures[self.current_texture]].copy() - display_img.set_alpha(100) + display_img.set_alpha(200) surf.blit(pg.transform.scale(display_img, self.apply_rect_transformations(display_img.get_rect()).size), self.apply_transformations(self.fit_to_grid(pg.mouse.get_pos(), use_floor=True))) for button in self.buttons: diff --git a/Levels/Level4.txt b/Levels/Level4.txt new file mode 100644 index 0000000..c60b00e --- /dev/null +++ b/Levels/Level4.txt @@ -0,0 +1,15 @@ +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|world +850.0,250.0|800.0,250.0|750.0,250.0|950.0,200.0|900.0,200.0|850.0,200.0|800.0,200.0|750.0,200.0|1000.0,200.0|1050.0,200.0|1100.0,200.0|1150.0,200.0|500.0,500.0|1050.0,500.0|1350.0,400.0|1350.0,450.0|1350.0,500.0|1350.0,350.0|1400.0,350.0|1400.0,300.0|1450.0,300.0|1500.0,300.0|1550.0,300.0|1600.0,300.0|1600.0,350.0|1550.0,350.0|1350.0,300.0|1600.0,400.0|1600.0,450.0|1600.0,500.0|1600.0,650.0|1250.0,650.0|1200.0,650.0|1150.0,650.0|400.0,650.0|350.0,650.0|300.0,650.0|300.0,700.0|350.0,700.0|400.0,700.0|1150.0,700.0|1200.0,700.0|1300.0,650.0|1350.0,650.0|1400.0,650.0|1450.0,650.0|1500.0,650.0|1550.0,650.0|1250.0,700.0|1300.0,700.0|1350.0,700.0|1400.0,700.0|1450.0,700.0|1500.0,700.0|1550.0,700.0|1600.0,700.0|750.0,450.0|1300.0,550.0|1250.0,550.0|1200.0,550.0|1150.0,550.0|1100.0,550.0|1050.0,550.0|1000.0,550.0|950.0,550.0|900.0,550.0|850.0,550.0|800.0,550.0|750.0,550.0|700.0,550.0|650.0,550.0|600.0,550.0|550.0,550.0|500.0,550.0|300.0,550.0|1350.0,550.0|1400.0,550.0|1450.0,550.0|1500.0,550.0|1550.0,550.0|1500.0,450.0|1600.0,600.0|1550.0,600.0|1500.0,600.0|1450.0,600.0|1400.0,600.0|1350.0,600.0|1300.0,600.0|1250.0,600.0|1200.0,600.0|1150.0,600.0|1050.0,600.0|1000.0,600.0|950.0,600.0|900.0,600.0|850.0,600.0|800.0,600.0|750.0,600.0|700.0,600.0|650.0,600.0|600.0,600.0|550.0,600.0|500.0,600.0|300.0,600.0|350.0,600.0|400.0,600.0|450.0,600.0|450.0,550.0|400.0,550.0|350.0,550.0|1600.0,550.0|1100.0,600.0|1100.0,650.0|1100.0,700.0|1050.0,700.0|1050.0,650.0|1000.0,650.0|1000.0,700.0|950.0,700.0|950.0,650.0|900.0,650.0|850.0,650.0|800.0,650.0|750.0,650.0|900.0,700.0|850.0,700.0|800.0,700.0|750.0,700.0|700.0,700.0|700.0,650.0|650.0,650.0|600.0,650.0|550.0,650.0|500.0,650.0|450.0,650.0|450.0,700.0|500.0,700.0|550.0,700.0|600.0,700.0|650.0,700.0|2000.0,500.0|2000.0,450.0|1900.0,500.0|1950.0,500.0|1950.0,450.0|1900.0,450.0 +SAND|SAND|SAND|STONEDIRT|STONEDIRT|STONEDIRT|STONEDIRT|STONEDIRT|STONEDIRT|STONEDIRT|STONEDIRT|STONEDIRT|PORTAL|INTERDIMENSIONALPOWDER|STONEBRICK|STONEBRICK|STONEBRICK|STONEBRICK|STONEBRICK|STONEBRICK|STONEBRICK|STONEBRICK|STONEBRICK|STONEBRICK|STONEBRICK|STONEBRICK|STONEBRICK|STONEBRICK|STONEBRICK|STONEBRICK|STONE|STONE|STONE|STONE|STONE|STONE|STONE|STONE|STONE|STONE|STONE|STONE|STONE|STONE|STONE|STONE|STONE|STONE|STONE|STONE|STONE|STONE|STONE|STONE|STONE|STONE|PLAYER|GRASS|GRASS|GRASS|GRASS|GRASS|GRASS|GRASS|GRASS|GRASS|GRASS|GRASS|GRASS|GRASS|GRASS|GRASS|GRASS|GRASS|GRASS|GRASS|GRASS|GRASS|GRASS|GRASS|ENEMY|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|CORNERGRASS|CORNERGRASS|CORNERGRASS|CORNERGRASS|CORNERGRASS|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|DIRT|CORNERDIRT|CORNERGRASS|DIRT|DIRT|GRASS|GRASS + + + + + + + + + + + + diff --git a/Player.py b/Player.py index d6904ae..f3953ff 100644 --- a/Player.py +++ b/Player.py @@ -143,27 +143,14 @@ class Player(Actor): self.state = "IDLE" elif self.state == "RUN": frame = math.floor(self.current_frame) - # if self.direction == 1: if self.velocity.x > 0: self.display = self.run_frames[math.floor(frame)] self.display_offsets["player"] = pg.Vector2(-40, -35) - - # elif self.direction == -1: elif self.velocity.x < 0: self.display = pg.transform.flip(self.run_frames[math.floor(frame)], True, False) self.display_offsets["player"] = pg.Vector2(-65, -35) - # else: - # self.direction = prev_direction - # if prev_direction == 1: - # self.display_offsets["player"] = pg.Vector2(-40, -35) - # - # self.display = self.run_frames[math.floor(frame)] - # elif prev_direction == -1: - # self.display = pg.transform.flip(self.run_frames[math.floor(frame)], True, False) - # self.display_offsets["player"] = pg.Vector2(-65, -35) - - self.current_frame = (self.current_frame + 1) % self.run_gif.n_frames + self.current_frame = (self.current_frame + 0.5) % self.run_gif.n_frames return self.position - center @@ -218,7 +205,7 @@ class Player(Actor): else: if self.state == "RUN": self.state = "IDLE" - self.running_sound_channel.stop() + self.running_sound_channel.stop() # self.lastValueL = pressed[pg.K_a] or pressed[pg.K_LEFT] # self.lastValueR = pressed[pg.K_d] or pressed[pg.K_RIGHT] diff --git a/Weapon.py b/Weapon.py index c1c3105..d717fd8 100644 --- a/Weapon.py +++ b/Weapon.py @@ -67,7 +67,7 @@ class Sword: img,_ = rotate(pg.Vector2(img.get_rect().topright),img, -30,pg.Vector2(img.get_rect().bottomleft)) flipped_img = pg.transform.flip(img,True,False) width,height = (75,200) - damage = 25 + damage = -25 def __init__(self, pos, offset, width,direction): self.position = pg.Vector2(pos) diff --git a/main.py b/main.py index ab84c27..b12117a 100644 --- a/main.py +++ b/main.py @@ -14,7 +14,7 @@ is_running = True # scene = TransitionScene() scene = DevLevelSelect() old_level = 0 -level = 4 +level = 0 next_level = 0 while is_running: