Example #1
0
            # Abbauanimation
            if (Erst_Kontakt + Abbaudauer - math.floor(time.time())
                ) >= -1 and Noch_Colidet.colliderect(Neuer_Cursor):
                Hilfe = Erst_Kontakt + Abbaudauer - math.floor(time.time())
                if Hilfe >= 9:
                    Hilfe = 9
                Fenster.blit(Abbau_Animation[Hilfe],
                             (Block.xPosition, Block.yPosition))

            # Wenn die Zwei Sekunden abgelaufen sind und nicht vorher direkt abgebaut wurde, sowie der cursor noch im Item ist wird abbgebaut
            if Erst_Kontakt + Abbaudauer == math.floor(time.time(
            )) and Abbau == False and Noch_Colidet.colliderect(Neuer_Cursor):
                dict.pop(Neuer_Cursor.collidelist(Formen))
                # item zum Inventar hinzufügen
                Inventar = Funktionen.Block_zu_Gegenstand(
                    Block.Blockart, Inventar)
                Abbau_Pos = False
                Abbau = True
        except:
            pass

        # Bilder hinzufügen, von den Gegenständen die im Inventar sind
        for i in Inventar:
            Zahl = i.Anzahl
            i = i.Gegenstandsart
            if i == "Bruchstein":
                InventarBilder.append(GS_Bruchstein)
            elif i == "Erde":
                InventarBilder.append(GS_Erde)
            elif i == "Eiche":
                InventarBilder.append(GS_Eiche)