Tank Game Code Review - panicarts.com

Tank Game Code Review

Engineer Man
Views: 49165
Like: 1515
Code Reviewing a Tank Game sent in by a fan who wished not to be named. Overall, good job.

Want your code reviewed on my channel? Send an email to [email protected] with your code and a brief explanation on what it is. Make sure to include your YouTube channel, Google+, Facebook, Twitter, or anything you want.

Hope you enjoyed the video!

Check out this code here:

Join my Discord server to chat with me:

Check out some code on my GitHub:

Tweet me something funny on Twitter:

Say hi over at Facebook:

Sincerely,
Engineer Man

74 Comments

  1. Hate to rain on y'alls parade, but this is example code copied pretty much verbatim from a book on Python Game programming. Not an original work. The book is called Beginning Game Development with Python and Pygame written by Will McGugan. The code is on pg 30-31 with full explanations of its functionality. Sorry to ruin this video for you guys. Good code review tho.

    I got the book from some random course I took on Game Programming a while back.

    P.S. I am not sure if this was an intentional thing or not, but if it was some clarification would be appreciated.

  2. Would you have a problem with some Unity C# code for review? It's a 'bit' lengthy (about 1500 lines so far with brackets) 😀 Also, it's kind of a prototype of a strategy game so far I made as a project a while back (like there's no real end to the game yet, but some core functionality like gathering ressources, building units in buildings and dealing damage is there already).

    Great videos btw 🙂
    Your explenation of things is really well done and I wouldn't mind some more complex stuff.
    Have a sub.

  3. You are awesome please keep making videos like this……
    Really helpful

  4. I liked it. I don't know any programming but I want to learn.

  5. Great video. Getting to see the mistakes and corrections is truly helpful.

  6. Great code and code review.
    I strongly suggest beginners to start learning python3 instead of python2 : you got no pre-existing bias, being beginners, and python2 is bound to be replaced by python3.

  7. I really like the 'open source' & 'community' vibe of this channel. Positive code review . I'm no Python expert, but I am Python literate and I enjoyed how the approach to troubleshooting was explained. A debug journey that is actually entertaining. Go fig.

  8. Just an idea to upgrade this, to add another dimension onto the game look at making the tanks movable. You could do this by havign a coordinate system with each tank places on a grid, each round a tank is givien the option of either firing or moving, and the closer 2 tanks are to each other the more likely they are to hit.

    You would have to add a coordnate atribute to the tank object (i.e. Tank.x and Tank.y).
    A movement method, maybe something like Tank.move(distance=1, direction='up').
    Maybe even add basic collision detection.
    Then you would have to make a distance calc function using Pythagoras theorem (a^2=b^2+c^2).
    Then a random hit or miss function which would take as input the result of the distance function to increase / deacrese the likelyhood of a hit or miss. There are many fun ways to implement this.
    If you want you could implement a playing field class to handle all of that.
    And maybe as iceing on the cake try and print it out as a text graphic.

    It would be cool if as part of your show in the future you not just review code but make sugestions on how to upgrade it and maybe even do a few upgrades yourself.

  9. Would you be willing to review a unity project? Would love your comments on how I half-assedly hacked together tetris….

  10. What code lanuages can the codes for the code reviews be in?

  11. Whoever made that.. That's pretty cool! I'm glad you sent it in!

  12. Code Review is simply awesome.
    Please keep making Code Review Videos.

  13. How did you mass edit the print (….) ? especially the trailing )

  14. Subscribed, keep up the good work Engineerman

  15. To whoever sent that program. Good job and hopefully you're still doing it, keep it up and it'll bring you good things. Cheers!

  16. This video was awesome. I am also a beginner and it was extremely helpful to watch someone who is very good to quickly identify errors and be able to think through what the author intended. I will look for more of these. Thank you for posting 🙂

  17. typos….can be a person worst nightmare.

  18. I’m trying to learn how to program and picked python. I’m learning programming as an older student, I’m in my late 40’s. I enjoyed this format. Hopefully others do too and you’ll continue. Thanks for teaching this old dog some new tricks.

  19. Great that you do such reviews.
    They are great fun to watch and really helpful too.

  20. I don’t even know Python as I’m currently refiner my JS, but the thought process and logic is very helpful and broaches the language barrier pretty seamlessly. Pretty sweet how the concepts translate so well.

    Keep it up! Thanks

  21. Eng. Man, how in the world did you select all commands listed and edited them all at once? It must be a shortcut on Atom and I believe debugging becomes much easier when you are able to edit multiple (equal) commands or syntax lines at the same time. Thank you always for sharing your extensive knowledge and logic in programming code analysis.

  22. Do you know emacs lisp? What about PHP,? Have stuff for review…

  23. Great review, hope to watch more of these. Very informative of both improvements and how to write python script.
    Thanks E. man

  24. I've been watching various videos on your channel for a few months now but this one finally pushed me over the edge to hit the sub button. Question: do you review C# code? I've got a small project I wrote about a year ago that I wouldn't mind having your eyes on.

  25. How did you correct all 4 print statements at the same time (without find and replace) — its magic 🙂

  26. Make another one!! also are computer scientists allowed on the engineer channel? xD

  27. Awesome videos😍👌👌👌upload more game codes videos…. 🙏💯💯

  28. Very nice code review! I like the respectful way, with which you approach someone else's work! It is supportive and very motivating! Thank you!

  29. Why would anyone send an (probably) not tested code for a review?

  30. I just found your channel and i loved your style. Totally gonna come back for more.

  31. Question for a beginner like me, how about the KeyError part? I can't get the message "No such tank".

  32. This seems like something someone would write in java as the _str_ was used like a java toString but not implemented the way you fixed it to have been in python! Nice stuff still your videos teach me something every time!

  33. Did we check the use case if someone dies and we decide to fire on the same tank again?
    Like what does it do then??
    BTW huge fan of your channel. Great code review!

  34. If I had code reviews like that, when I was starting… Maybe I wouldn't have grey hair strands by 25 🙂

  35. Nice review. I like how you emphasised the positives and downplayed the minor issues. The author will take it well and learn from this positive experience. You've shown humility and experience. 👍🏻

  36. I enjoyed the Code Review Video. I thought you were very considerate in your review, and helped teach rather than just criticize. I enjoy your channel and would like to see more code reviews like this and even if they are more technical. When you are making quick edits like in the few that you made in the Tank Game, could you take a moment and share your keystrokes. I always seem, to have a difficulty in getting edits made properly in VSC when they involve multiple lines and locations. Thanks for the Great Channel. Respectfully Robert Tonkavich

  37. I don't know if you did already, but why don't you go on reddit and check out r/badcode and review and give your opinion on those.
    Maybe sort by top of all time to get the absolut worst code posted for the first video and then sort by top of last week for a little weekly series

  38. This was great to watch!

    At what stage of the learning to program journey should someone be able to produce something like this?

Leave a Reply

Your email address will not be published.