# How do you make static methods in python? With MakeCode Arcade

**URL:** https://forum.makecode.com/t/how-do-you-make-static-methods-in-python-with-makecode-arcade/31317
**Category:** Help
**Tags:** make, game
**Created:** [October 23, 2024, 4:13pm UTC](https://forum.makecode.com/t/how-do-you-make-static-methods-in-python-with-makecode-arcade/31317 "2024-10-23T16:13:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ACalto](https://avatars.discourse-cdn.com/v4/letter/a/9f8e36/32.png) [@ACalto](https://forum.makecode.com/u/ACalto)
#### Post date: [October 23, 2024, 4:13pm UTC](https://forum.makecode.com/t/how-do-you-make-static-methods-in-python-with-makecode-arcade/31317/1 "2024-10-23T16:13:11Z")

</div>

```class
    brickInstances = []

    def __init__ (self, x, y, hitPoints: number):
        picture
        if hitPoints == 1:
            picture = assets.image("""brick""")
        elif hitPoints == 2:
            picture = assets.image("""brick0""")
        elif hitPoints == 3:
            picture = assets.image("""brick1""")
        elif hitPoints == 4:
            picture = assets.image("""brick2""")
        self._brick = sprites.create(picture, SpriteKind.enemy)
        self._brick.set_position(x,y)
        self._brick.scale = 0.8
        #below line is from an extension
        sprites.set_data_number(self._brick, "identifier", len(Brick.brickInstances))
        Brick.brickInstances.append(self)
        self.hitPoints = hitPoints

    def __getInstance(self, index):
        return Brick.brickInstances[index]

    def Hit(self):
        if self.hitPoints > 1:
            self.hitPoints -= 1
            info.change_score_by(100)
        else:
            # drop power up
            Brick.brickInstances.remove_at(sprites.read_data_number(self._brick, "identifier"))
            info.change_score_by(1000)

```

my entire class just in case I made more mistakes or am doing “bad practice”.  
Im trying to recreate Arkanoid in MakeCode and im using a class to manage the bricks… i wanted to store each instance of brick to a list that i can access later when overlapped with ball (i have an extension which should help know what index to look for) But i cant use my method getInstance because its not static.

below is how I call that method `def on_overlap_balls_bricks(ball, brick): brickInstance = Brick.__getInstance(sprites.read_data_number(brick, "indentifier")) brickInstance.Hit()`
