aidan

former girlboss in chief

one quarter of @staff! i make the website look good and/or bad depending on your personal taste


here's my website
www.aidangrealish.com/

hthrflwrs
@hthrflwrs

//Start is called before the first frame update


johnnemann
@johnnemann

//Update is called once per frame


Webster
@Webster

when i was in college i took an unelective game development class that taught unity to students. the final assignment was to create "duck hunt" from scratch (the irony is not lost on me). i wrote some code that would make the duck change directions every 500ms or so and i wrote the script to kill the duck when it was clicked. i didn't understand OOP very well yet, but one of the requirements was to instantiate an object, so i put some conditional logic on the update method that would instantiate a new Duck() if the current one was dead.

the result of this was that, upon killing the first duck, 60 ducks would infinitely spawn per second, flooding the screen and filling the heap like a cosmic horror emerging to exact it's revenge.


You must log in to comment.

in reply to @Webster's post:

complete, no bugs, thank you for playing lol

ah wait I think I got it, if you managed to kill a second duck, it would then generate two ducks per frame lol, because the logic is per duck, and said duck continues to be dead every frame?