free-friday 5/8

So sadly, i was stuck de-bugging the game almost the entire time, trying to fix my game’s errors, and the power system(which still DOESN’T work.)


With the help of my teacher (Mr.Wilmoth), He helped me update my Main.py, so it can pass anything in the game instead of me having to go in each file and pass it myself.


class Game:
    def __init__(self):
        pygame.init()
        self.screen = pygame.display.set_mode((800, 800))
        pygame.display.set_caption("Five Nights In Atlanta")

        self.clock = pygame.time.Clock()
        self.running = True

        # Start with the title screen
        self.manager = SceneManager(TitleScreen())
        

    def run(self):
        while self.running:
            dt = self.clock.tick(60)

            events = pygame.event.get()
            for e in events:
                if e.type == pygame.QUIT:
                    self.running = False

            # Scene logic
            self.manager.handle_events(events)
            self.manager.update(dt)
            self.manager.draw(self.screen)

            pygame.display.flip()

        pygame.quit()



Second, I fixed an error that wouldn’t like the camera’s switch, updated this

    def update(self, dt):
        new_scene = self.current_scene.update(dt)
        if new_scene:
            self.current_scene = new_scene



And lastly, I added a placeholder Animatronic.

import pygame
import random

class Animatronic:
    def __init__(self):
        self.room = 0
        self.move_timer = 0
        self.move_interval = 2000  # ms

    def update(self, dt):
        self.move_timer += dt
        if self.move_timer >= self.move_interval:
            self.move_timer = 0
            if random.random() < 0.5:
                self.room = min(self.room + 1, 5)



I know I didn’t get to do much, but figuring this stuff out without A.I is difficult, hopefully next week, i can get the power to display on the screen, and I can add my first enemy.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top