Discord
Login
Community
DARK THEME

Help with my fnaf game

im trying to make a fnaf game off of the "robots are going rouge" by DanMan97 and i cant get any of them to move anymore on night 2 i cant get foxy or bonnie or chica to move what should i do heres there code

Chica : def anim(ai): import random global place1 global time1 global check1 global doorl global doorr global alive global killer global whchsd1 global digit if check1 == 0: check1 = random.randint(1,20) if time1 != 0: time1 -= 1 if time1 <= 0: time1 = 200 if place1 == 1: whchsd1 = 0 if alive == True: if time1 == 50: if ai >= check1: place1 = place1 + 1 check1 = 0 else: check1 = 0 if digit == 6 or alive == False: place1 = 1 if place1 >= 6: if whchsd1 == 0: whchsd1 = random.randint(1,2) if whchsd1 == 1: screen.drawSprite("animatronic_4",-162.5,0,100) if whchsd1 == 2: screen.drawSprite("animatronic_4",162.5,0,100)

screen.drawText(place1,0,0,20,"rgb(255,255,255)") screen.drawText(time1,0,20,20,"rgb(255,255,255)")

if place1 == 8: if doorl == True and whchsd1 == 1: place1 = random.randint(2,3) elif doorr == True and whchsd1 == 2: place1 = 1 else: alive = False killer = "Rouge" storage.set("killer","deathscreen4")

Bonnie

def ani3(ai): import random global place3 global time3 global check3 global doorl global doorr global alive global killer global whchsd3 global digit,moniplce,detect if check3 == 0: check3 = random.randint(1,20) if time3 != 0: time3 -= 1 if time3 <= 0: time3 = 200 if place3 == 1: whchsd3 = 0

if digit == 6 or alive == False: place3 = 1 detect = False

if alive == True: if time3 == 50: if ai >= check3: place3 = place3 + 1 check3 = 0 else: check3 = 0

if place3 >= 6: if whchsd3 == 0: whchsd3 = random.randint(1,2) if whchsd3 == 1 and camon == True and camplce == 3: if moniplce == 3: detect = True screen.drawSprite("animatronic_3",-150,-40,90) if whchsd3 == 2 and camon == True and camplce == 4: if moniplce == 4: detect = True screen.drawSprite("animatronic_3",100,0,80)

#screen.drawText(place3,0,0,20,"rgb(255,255,255)") #screen.drawText(time3,0,20,20,"rgb(255,255,255)")

if place3 == 8: if doorl == True and whchsd3 == 1: place3 = random.randint(2,3) detect = False elif doorr == True and whchsd3 == 2: place3 = 1 detect = False else: alive = False killer = "debuty doofy" storage.set("killer","deathscreen3")

Foxy

def anim2(ai): import random global place2 global time2 global check2 global doorl global doorr global alive global killer global whchsd2 global run global camclk global digit global moniplce global detect if run == 0: run = random.randint(4,6)

if digit == 6 or alive == False: place2 = 1 detct = False

if alive == True and camon == False: if check2 == 0: check2 = random.randint(1,20)

if time2 != 0: time2 -= 1

if time2 <= 0: time2 = 200 - 10*(camclk-10)

if time2 == 1: if lightm == True and place2 >= run: place2 = 1 run = 0 camclk = 0

if ai >= check2+1: place2 = place2 + 1 check2 = 0 else: check2 = 0 if place2 == run or place2 == run + 1: if moniplce == 2: detect = True screen.drawSprite("animatronic_2",-30,30,90)

if place2 == run + 2 and lightm == False: alive = False killer = "Medic" storage.set("killer","deathscreen2")

if moniplce == 2 and place2 <= run: detect = False

#end

And btw i am a new coder trying to learn this is my first half try attempt at a game

Oh if you see this DanMan97 can i upload it cause it does use most of your code thanks in the meantime

if i need to give more information i can so please help --CAMB3N0

If you want to post code in the future, please wrap it in triple back ticks for better readability.

It should look somewhat like this in the input box.

```

You need to put one before you code block and one again after.

Anyways, you made several SEVERE typing errors. First, a class is defined by first writing class, and then the name.

In the following example, I create a class Barnaby, with a function called draw, and a test variable. You should also inform yourself about python Inheritance, just to get a better idea.

class Barnaby:
  def __init__(self):
    self.test = True

  def draw(self):
    pass

Please note that the intendation is necessary. Using classes can avoid function conflicts and orders everything more neatly. Also, don't initialize everything on a global scale, that can backfire extremely quickly.

I'll leave it open to you to write it yourself. It shouldn't be insanely difficult, and I hope you can pull it off.

Finally, use the help tag if you're in need of help, as bugs refers to a bug with the ENGINE, not your code.

thanks so much that is going to help!

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community