Quick game development with C++11/C++14
Vittorio Romeo
http://vittorioromeo.info
vittorio.romeo@outlook.com
Quick game development with C++11 / C++14 Vittorio Romeo - - PowerPoint PPT Presentation
Quick game development with C++11 / C++14 Vittorio Romeo http://vittorioromeo.info vittorio.romeo@outlook.com About myself Computer Science student at the University of Messina Autodidact programmer Interests: Software development
Vittorio Romeo
http://vittorioromeo.info
vittorio.romeo@outlook.com
Vittorio Romeo
http://vittorioromeo.info
vittorio.romeo@outlook.com
at the University of Messina
– Software development – Gaming and game-
development
– C++ and its evolution – Open-source software – Sharing my knowledge
Vittorio Romeo
http://vittorioromeo.info
vittorio.romeo@outlook.com
– Game development: why?
– Preparation: goals,
compilers, resources
– Live coding: development
analysis/walkthrough of a complete playable simple game
Vittorio Romeo
http://vittorioromeo.info
vittorio.romeo@outlook.com
Vittorio Romeo
http://vittorioromeo.info
vittorio.romeo@outlook.com
– Requires knowledge
– Involves the
– Touches a vast
Game development
Design
Implementation
Resources
Mechanics
Style and feel
Story and concept
Engine and architecture
Scripting and customization
Porting and distribution
Graphics
Music
Sounds
Vittorio Romeo
http://vittorioromeo.info
vittorio.romeo@outlook.com
Vittorio Romeo
http://vittorioromeo.info
vittorio.romeo@outlook.com
– Initializer lists and uniform initialization – auto, range-based for loops – Lambdas, variadic templates, decltype – override, final, enum class, explicit, nullptr – default, delete
– std::unique_ptr, std::shared_ptr, offsetof
– constexpr, std::move, noexcept
– Multithreading library facilities – std::tuple, variadic macros, <random>, <chrono> – Generic lambdas, lambda capture expression – auto functions, relaxed constexpr, std::tuple::get<...>
game loop timing factory functions
entity management
Vittorio Romeo
http://vittorioromeo.info
vittorio.romeo@outlook.com
Vittorio Romeo
http://vittorioromeo.info
vittorio.romeo@outlook.com
– g++ 4.7.2 or clang++ 3.0 (or newer) fully support the
C++11 standard
– clang++ 3.4 fully supports the C++14 standard – g++ 4.9 supports all the C++14 features we'll be using
– http://gcc.gnu.org/projects/cxx1y.html – http://clang.llvm.org/cxx_status.html
Vittorio Romeo
http://vittorioromeo.info
vittorio.romeo@outlook.com
Vittorio Romeo
http://vittorioromeo.info
vittorio.romeo@outlook.com
– http://github.com/SuperV1234/cppcon2014
– http://sfml-dev.org
Vittorio Romeo
http://vittorioromeo.info
vittorio.romeo@outlook.com
– 1. Get input – 2. Update game logic – 3. Draw game entities
Vittorio Romeo
http://vittorioromeo.info
vittorio.romeo@outlook.com
X (0, 0) (width, 0) (width, height) (0, height)
Vittorio Romeo
http://vittorioromeo.info
vittorio.romeo@outlook.com
velocity velocity velocity update update update time
Vittorio Romeo
http://vittorioromeo.info
vittorio.romeo@outlook.com
the window's bounds, we can determine if the ball is outside the window.
ball.x + (ball.width / 2)
X window.width
Vittorio Romeo
http://vittorioromeo.info
vittorio.romeo@outlook.com
horizontal overlap vertical overlap (right - left)
(top, left) (top, right) (bottom, left) (bottom, right) (bottom, left) (bottom, right) (top, left) (top, right)
(bottom - top)
Vittorio Romeo
http://vittorioromeo.info
vittorio.romeo@outlook.com
Vittorio Romeo
http://vittorioromeo.info
vittorio.romeo@outlook.com
Vittorio Romeo
http://vittorioromeo.info
vittorio.romeo@outlook.com
Entity
(base)
Rectangle
(mix-in)
Circle
(mix-in)
Vittorio Romeo
http://vittorioromeo.info
vittorio.romeo@outlook.com
Game Manager Entities Grouped entities
Vittorio Romeo
http://vittorioromeo.info
vittorio.romeo@outlook.com