]> Skullheadx's Git Forge - Pygame-Jam.git/commitdiff
new assets
authorSkullheadx <704277@pdsb.net>
Mon, 11 Jul 2022 18:30:03 +0000 (14:30 -0400)
committerSkullheadx <704277@pdsb.net>
Mon, 11 Jul 2022 18:30:03 +0000 (14:30 -0400)
12 files changed:
Assets/SFX/Running_Sound_Effect.wav
Assets/world/blocks/STONEBRICK.png [new file with mode: 0644]
Assets/world/blocks/STONEDIRTCORNER.png [new file with mode: 0644]
Assets/world/decor/INTERDIMENSIONALPOWDER.png [new file with mode: 0644]
Assets/world/decor/PEDESTAL.png [new file with mode: 0644]
Assets/world/decor/PILLAR_.png [new file with mode: 0644]
Function/Portal.py
LevelCreator.py
Levels/Level4.txt [new file with mode: 0644]
Player.py
Weapon.py
main.py

index 8b80933a9177052d008de70af97c2c8692c44e4f..21a286ca798559ed44e48732f36a9111b425126b 100644 (file)
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 (file)
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 (file)
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 (file)
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 (file)
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 (file)
index 0000000..b7041a3
Binary files /dev/null and b/Assets/world/decor/PILLAR_.png differ
index 16f3b9d0e31b8b40beb3433b0cdd868e500fa5ea..feb4a051339612be5b59f08b7be0208937c1642f 100644 (file)
@@ -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
index e49021ac929fdde06f5a9c2a8decabb7ca6a3d9a..2897f413b8e4681917dba994528358024f8d8a11 100644 (file)
@@ -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 (file)
index 0000000..c60b00e
--- /dev/null
@@ -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
+
+
+
+
+
+
+
+
+
+
+
+
index d6904aeb7283ac847d24c8190fb29f58a5bbdd56..f3953ff288c8c334a6574f666ee0498ed5c322d9 100644 (file)
--- 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]
index c1c3105e9cd569308c57df693f6398678a195dd0..d717fd8e655a59761dcd22c291769b4cd46624c1 100644 (file)
--- 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 ab84c277ccc1c91bdc3c9695ffe34021a43ac179..b12117ac35dd2f9ef3cfab65c155943d9f68b4eb 100644 (file)
--- 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: