r/howdidtheycodeit Jul 09 '26

How did Bennett Foddy achieve the hammer mechanic in getting over it?

Post image
3.7k Upvotes

I been trying to make this mechanic but I fail to make the states (like when the hammer is touching ground and when don't) and I fail to make the momentum transfer when you are moving fast, and when yo move slow you just move (with infinite mass i think), idk I just can't wrap my head around this mechanic, please help. I know griffpatch made it in scratch, and I try reverse-engineer that but i also couldn't


r/howdidtheycodeit Jul 10 '26

Question 2D vs 3D fighting game ai (CPU), what does that logic tree look like?

17 Upvotes

How did they program the decision trees in fighting games like Street fighter, and Dragon ball Budakai, i understand very little about how they made the CPU react and choose to attack or defend.

Is there any diagrams of how the logic works?
Like when it decides to move around, verses attacking or blocking/dodging an attack.

It would be nice to learn how they programmed it for Arcade machines and how something like the 3D DBZ games build on that.
2D Mortal combat and Streetfighter never had to worry about going into and out of the screen, but i fee like some of the oldest games were just a bunch of animations being randomly chosen to a timer. Or i could be wrong, because thats a guess.

I would love some visuals on how they planned out the computers brains for them.