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
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)):
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])
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
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:
--- /dev/null
+world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|world|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
+
+
+
+
+
+
+
+
+
+
+
+
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
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]
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)
# scene = TransitionScene()
scene = DevLevelSelect()
old_level = 0
-level = 4
+level = 0
next_level = 0
while is_running: