DukeNukem/Doom cheat codes System-like

Hey there!! I really enjoyed this one!!! Actually it took me like 3 hours to figure out what I wanted to achieve!!! Do you remember those old games where you have to enter an actual word or combination of letters to activate a cheat code?? Like DukeNukem 3D or Doom!!! So, somehow I got it done… it has a little bug but it fixes itself hahahahha.

I created a separate class to handle a ‘buffer’ that checks what is happening on the keyboard and excludes the movement keys… I also created a handy setter for the boolean at collision handler script… With exclusion keys I tried to implement a real-time buffer but I got really… funky results… so I took a more ‘simplistic’ approach… I must say… It was A LOT of fun to figure out this thing…!!

1 Like

Great job tackling the challenge head on. I like your creativity! The course hasn’t yet discussed coroutines, but a different approach could be starting a coroutine that listens to player input similar to what you’ve done. A benefit of using a coroutine is that you can have it run only when the user presses the first character of the sequence instead of having it constantly check in the update loop.

Your implementation is awesome and uses what we’ve learned so far in a great way!!!

1 Like

Thank you!! That is a really good idea!!! I also saw in another course on youtube something called delegates… and imagination always flies away!!! haha thanks again!!!

Privacy & Terms