@@ -29,20 +29,22 @@ def loadSvg(svg_bytes):
2929
3030
3131# Render a sprite at its coordinates
32- def render (sprite , x , y ):
32+ def render (sprite , x , y , direction ):
3333 # convert Scratch coordinates into Pygame coordinates
34+ sprite = pygame .transform .scale (sprite , (sprite .get_width () * 2 , sprite .get_height () * 2 ))
35+ # sprite = pygame.transform.rotate(sprite, 100)
3436 finalX = x + WIDTH // 2 - sprite .get_width () // 2
3537 finalY = HEIGHT // 2 - y - sprite .get_height () // 2
3638 display .blit (sprite , (finalX , finalY ))
3739
3840
3941# Set the stage background
4042def setBackground (bg ):
41- render (bg , 0 , 0 )
43+ render (bg , 0 , 0 , 90 )
4244
4345
4446# Prepare project file
45- projectToLoad = "ifonedgebounce .sb3" # change this to load a different project
47+ projectToLoad = "mascots .sb3" # change this to load a different project
4648targets , currentBgFile , project = s2p_unpacker .sb3_unpack (projectToLoad )
4749wn = tk .Tk () # Start tkinter for popups
4850wn .withdraw () # Hide main tkinter window
@@ -51,8 +53,8 @@ def setBackground(bg):
5153pygame .init () # Start pygame
5254scratch .startProject ()
5355# Set player size
54- HEIGHT = 360
55- WIDTH = 480
56+ HEIGHT = 720
57+ WIDTH = 960
5658projectName = projectToLoad [:- 4 ] # Set the project name
5759icon = pygame .image .load ("icon.png" )
5860display = pygame .display .set_mode ([WIDTH , HEIGHT ])
@@ -90,7 +92,7 @@ def setBackground(bg):
9092 # Move all sprites to current position and direction
9193 setBackground (currentBg )
9294 for target in targets :
93- render (loadSvg (target .costumes [target .currentCostume ].file ), target .x , target .y )
95+ render (loadSvg (target .costumes [target .currentCostume ].file ), target .x * 2 , target .y * 2 , 90 )
9496 for _ , block in target .blocks .items ():
9597 if not block .blockRan and block .opcode == "event_whenflagclicked" :
9698 print ("DEBUG: Running opcode" , block .opcode )
0 commit comments