Difference between revisions of "Beginner C++ Game Programming Tutorial 11"

From Chilipedia
Jump to: navigation, search
(Concepts Taught)
m (Const Correctness)
Line 7: Line 7:
  
 
== Const Correctness ==
 
== Const Correctness ==
The use of <code>const</code> as as a means of communication by code and as method to prevent you and other people from shooting you (your code / themselves) in the dick is something that Chili finds cromulent. For some info on how <code>const</code> makes your code less shitty, check [https://isocpp.org/wiki/faq/const-correctness#const-and-type-safety this]. If you're still not sold (I happen to like being a human dumpster fire, thank you very much Chili), here is a video showing how using <code>const</code> can make your code a fuck of a lot faster: [https://www.youtube.com/watch?v=zBkNBP00wJE&feature=youtu.be&t=1455 cool beans].
+
The use of <code>const</code> as a means of communication by code and as method to prevent you and other people from shooting you (your code / themselves) in the dick is something that Chili finds cromulent. For some info on how <code>const</code> makes your code less shitty, check [https://isocpp.org/wiki/faq/const-correctness#const-and-type-safety this]. If you're still not sold (I happen to like being a human dumpster fire, thank you very much Chili), here is a video showing how using <code>const</code> can make your code a fuck of a lot faster: [https://www.youtube.com/watch?v=zBkNBP00wJE&feature=youtu.be&t=1455 cool beans].
  
 
== Video Timestamp Index ==
 
== Video Timestamp Index ==

Revision as of 08:04, 6 June 2018

References are sweet because they let us control our shit from far away. Remember the days when we had to actually get up to change the channel on the TV? Remember TV? Fuck that shit! Also, const correctness is for big dick gangstas that don't give any fucks.

Concepts Taught

  • References
  • Passing by reference
  • const correctness (redux)

Const Correctness

The use of const as a means of communication by code and as method to prevent you and other people from shooting you (your code / themselves) in the dick is something that Chili finds cromulent. For some info on how const makes your code less shitty, check this. If you're still not sold (I happen to like being a human dumpster fire, thank you very much Chili), here is a video showing how using const can make your code a fuck of a lot faster: cool beans.

Video Timestamp Index

Coming soon!

Homework

  1. Move the drawing code for Dude from Game into the Dude class.
  2. Make a second DrawRect function that takes a single point (top left corner) and the dimensions as parameters.

The solution is given in this video.

Downloads

See also