Difference between revisions of "Intermediate C++ Game Programming Tutorial 25"

From Chilipedia
Jump to: navigation, search
Line 2: Line 2:
  
 
== Topics Covered ==
 
== Topics Covered ==
* stff
+
* Function pointers
 +
* Functionoids
 +
* <code>std::function</code>
 
=== Bonus Video ===
 
=== Bonus Video ===
* more stuff
+
* more stuff about hardcore <functional> stuff and other bullshit (like member function pointers)
  
 
== Video Timestamp Index ==
 
== Video Timestamp Index ==
* [https://youtu.be/JlPsCoCO99o Tutorial 24.1]
+
* [https://www.youtube.com/watch?v=S2ZEEkquGy4 Tutorial 25]
* [https://youtu.be/LsjFAx-dG5I Tutorial 24.2]
+
  
 
== Homework Assignment ==
 
== Homework Assignment ==
 +
This homework might wreck your butthole a little, but hopefully not too badly. Anyways, you get the code from the repo, you try and get it to build. The project requires Box2D, but the repo doesn't have it included so you're gonna need to wrangle it yourself. The easiest way to accomplish this is to pull in dependencies into your system with vcpkg. Some of you are probably going to run into some speed bumps at this point getting vcpkg to work on your system, but I recommend powering through and not giving the fuck up, because vcpkg is immensely useful for adding amazing libraries to your projects easily.
  
Gonna be hard m8
+
After you get that shit working, the party has just started. Then you need to figure out how the codebase actually works. Use all the tools at your disposal (debugger, Google, Box2D documentation, etc.), and don't get bogged down in unimportant distractions (you don't need to know how the triangle rendering pipeline works to understand the general simulation system, for example).
 +
 
 +
The actual tasks are, as laid out in the video:
 +
# Implement destruction of boxes when two boxes with the same color trait hit each other
 +
# Implement a box splitting mechanic
 +
# Implement a pattern matching collision event manager based on std::unordered_map (this is the main task that ties into Intermediate 25)
 +
# Use the pattern matching system together with box splitting and other effects to define simulation with various action that occur based on what colors of boxes collide with each other.
 +
 
 +
Chili will hook you up with a solution video that A) explains the starting codebase in some detail and B) goes over the process of implementing all the the above.
 +
 
 +
The repo: [https://github.com/planetchili/boxyboi]
  
 
== See also ==
 
== See also ==
 
* [[Intermediate C++ Game Programming Series]]
 
* [[Intermediate C++ Game Programming Series]]

Revision as of 01:20, 7 April 2018

Function pointers allow you to store and change what function is to be called dynamically at runtime. Combine that with containers to have collections of actions/behaviors that can be selected from, and then jam in the power std::function to allow you to wrap up pretty much any kind of callable thing and bring them together in one container. Groovy.

Topics Covered

  • Function pointers
  • Functionoids
  • std::function

Bonus Video

  • more stuff about hardcore <functional> stuff and other bullshit (like member function pointers)

Video Timestamp Index

Homework Assignment

This homework might wreck your butthole a little, but hopefully not too badly. Anyways, you get the code from the repo, you try and get it to build. The project requires Box2D, but the repo doesn't have it included so you're gonna need to wrangle it yourself. The easiest way to accomplish this is to pull in dependencies into your system with vcpkg. Some of you are probably going to run into some speed bumps at this point getting vcpkg to work on your system, but I recommend powering through and not giving the fuck up, because vcpkg is immensely useful for adding amazing libraries to your projects easily.

After you get that shit working, the party has just started. Then you need to figure out how the codebase actually works. Use all the tools at your disposal (debugger, Google, Box2D documentation, etc.), and don't get bogged down in unimportant distractions (you don't need to know how the triangle rendering pipeline works to understand the general simulation system, for example).

The actual tasks are, as laid out in the video:

  1. Implement destruction of boxes when two boxes with the same color trait hit each other
  2. Implement a box splitting mechanic
  3. Implement a pattern matching collision event manager based on std::unordered_map (this is the main task that ties into Intermediate 25)
  4. Use the pattern matching system together with box splitting and other effects to define simulation with various action that occur based on what colors of boxes collide with each other.

Chili will hook you up with a solution video that A) explains the starting codebase in some detail and B) goes over the process of implementing all the the above.

The repo: [1]

See also