created Invisible Block

main
Jonas Wächter 2023-03-29 16:41:35 +02:00
parent 6a2614ec77
commit 8972a01028
4 changed files with 29 additions and 2 deletions

View File

@ -13,6 +13,19 @@
} }
] ]
}, },
{
"id": "invisible",
"subsheets": [
{
"id": "1",
"delays": [
1
],
"width": 12,
"height": 12
}
]
},
{ {
"id": "goal_door", "id": "goal_door",
"subsheets": [ "subsheets": [

View File

@ -3,6 +3,7 @@ from typing import Optional
from level.Level import Level from level.Level import Level
from level.elements.dynamic.BouncingBallLevelElement import BouncingBallLevelElement from level.elements.dynamic.BouncingBallLevelElement import BouncingBallLevelElement
from level.elements.dynamic.PushableBoxLevelElement import PushableBoxLevelElement from level.elements.dynamic.PushableBoxLevelElement import PushableBoxLevelElement
from level.elements.static.InvisibleElement import InvisibleElement
from level.elements.static.VacuumCleanerElement import VacuumCleanerElement from level.elements.static.VacuumCleanerElement import VacuumCleanerElement
from level.elements.static.GoalDoorReceiverLevelElement import GoalDoorReceiverLevelElement from level.elements.static.GoalDoorReceiverLevelElement import GoalDoorReceiverLevelElement
from level.elements.static.SpikeLevelElement import SpikeLevelElement from level.elements.static.SpikeLevelElement import SpikeLevelElement
@ -42,7 +43,8 @@ TILES = {
'<': SpikeLevelElement, '<': SpikeLevelElement,
'>': SpikeLevelElement, '>': SpikeLevelElement,
'A': VacuumCleanerElement 'A': VacuumCleanerElement,
'i': InvisibleElement
} }

View File

@ -0,0 +1,11 @@
from level.Level import Level
from level.elements.static.StaticLevelElement import StaticLevelElement
from physics.SpriteManager import SpriteManager
from sprite.SpritesheetManager import SpritesheetManager
class InvisibleElement(StaticLevelElement):
def load(self, sprite_manager: SpriteManager, spritesheet_manager: SpritesheetManager, level: Level):
self.spritesheet = spritesheet_manager.get_sheet('invisible')
self.set_animation_state('1')
self.position_scale.position = self.tile['position']

View File

@ -12,7 +12,8 @@ BLOCK_TYPES = {
'l': 'block_left', 'l': 'block_left',
'r': 'block_right', 'r': 'block_right',
'~': 'block_top_left', '~': 'block_top_left',
'|': 'block_top_right' '|': 'block_top_right',
'i': 'invisible'
} }