Opis
The second edition of Beginning C++ Game Programming is updated and improved to include the latest features of Visual Studio 2019, SFML, and modern C++ programming techniques. With this book, youll get a fun introduction to game programming by building five fully playable games of increasing complexity. Youll learn to build clones of popular games such as Timberman, Pong, a Zombie survival shooter, a coop puzzle platformer and Space Invaders.The book starts by covering the basics of programming. Youll study key C++ topics, such as object-oriented programming (OOP) and C++ pointers, and get acquainted with the Standard Template Library (STL). The book helps you learn about collision detection techniques and game physics by building a Pong game. As you build games, youll also learn exciting game programming concepts such as particle effects, directional sound (spatialization), OpenGL programmable shaders, spawning objects, and much more. Finally, youll explore game design patterns to enhance your C++ game programming skills.By the end of the book, youll have gained the knowledge you need to build your own games with exciting features from scratch Spis treści:Beginning C++ Game Programming Second EditionWhy subscribe?ContributorsAbout the authorAbout the reviewerPackt is searching for authors like youPrefaceWho this book is forWhat this book coversTo get the most out of this bookDownload the example code filesDownload the color imagesConventions usedGet in touchReviewsChapter 1: C++, SFML, Visual Studio, and Starting the First GameThe games we will buildTimber!!!PongZombie ArenaThomas was lateSpace Invaders ++Meet C++Microsoft Visual StudioSFMLSetting up the development environmentWhat about Mac and Linux?Installing Visual Studio 2019 Community editionSetting up SFMLCreating a new projectConfiguring the project propertiesPlanning Timber!!!The project assetsOutsourcing the assetsMaking your own sound FXAdding the assets to the projectExploring the assetsUnderstanding screen and internal coordinatesGetting started with coding the gameMaking code clearer with commentsThe main functionPresentation and syntaxReturning values from a functionRunning the gameOpening a window using SFML#including SFML featuresOOP, classes, and objectsUsing namespace sfSFML VideoMode and RenderWindowRunning the gameThe main game loopWhile loopsC-style code commentsInput, update, draw, repeatDetecting a key pressClearing and drawing the sceneRunning the gameDrawing the games backgroundPreparing the Sprite using a TextureDouble buffering the background spriteRunning the gameHandling errorsConfiguration errorsCompile errorsLink errorsBugsSummaryFAQChapter 2: Variables, Operators, and Decisions Animating SpritesC++ variablesTypes of variablesDeclaring and initializing variablesManipulating variablesC++ arithmetic and assignment operatorsGetting things done with expressionsAdding clouds, a tree, and a buzzing beePreparing the treePreparing the beePreparing the cloudsDrawing the tree, the bee, and the cloudsRandom numbersGenerating random numbers in C++Making decisions with if and elseLogical operatorsC++ if and elseIf they come over the bridge, shoot them!Shoot them or else do this insteadReader challengeTimingThe frame rate problemThe SFML frame rate solutionMoving the clouds and the beeGiving life to the beeBlowing the cloudsSummaryFAQChapter 3: C++ Strings and SFML Time Player Input and HUDPausing and restarting the gameC++ StringsDeclaring StringsAssigning a value to a StringManipulating StringsSFMLs Text and Font classesImplementing the HUDAdding a time-barSummaryFAQChapter 4: Loops, Arrays, Switches, Enumerations, and Functions Implementing Game MechanicsLoopswhile loopsfor loopsArraysDeclaring an arrayInitializing the elements of an arrayWhat do these arrays really do for our games?Making decisions with switchClass enumerationsGetting started with functionsFunction return typesFunction namesFunction parametersThe function bodyFunction prototypesOrganizing functionsFunction gotcha!More on functionsAn absolute final word on functions for nowGrowing the branchesPreparing the branchesUpdating the branch sprites each frameDrawing the branchesMoving the branchesSummaryFAQChapter 5: Collisions, Sound, and End Conditions Making the Game PlayablePreparing the player (and other sprites)Drawing the player and other spritesHandling the players inputHandling setting up a new gameDetecting the player choppingDetecting a key being releasedAnimating the chopped logs and the axeHandling deathSimple sound FXHow SFML sound worksWhen to play the soundsAdding the sound codeImproving the game and the codeSummaryFAQChapter 6: Object-Oriented Programming Starting the Pong GameOOPEncapsulationPolymorphismInheritanceWhy use OOP?What exactly is a class?The theory of a Pong BatThe class variable and function declarationsThe class function definitionsUsing an instance of a classCreating the Pong projectCoding the Bat classCoding Bat.hConstructor functionsContinuing with the Bat.h explanationCoding Bat.cppUsing the Bat class and coding the main functionSummaryFAQChapter 7: Dynamic Collision Detection and Physics Finishing the Pong GameCoding the Ball classUsing the Ball classCollision detection and scoringRunning the gameSummaryFAQChapter 8: SFML Views Starting the Zombie Shooter GamePlanning and starting the Zombie Arena gameCreating a new projectThe project assetsExploring the assetsAdding the assets to the projectOOP and the Zombie Arena projectBuilding the player the first classCoding the Player class header fileCoding the Player class function definitionsControlling the game camera with SFML ViewStarting the Zombie Arena game engineManaging the code filesStarting to code the main game loopSummaryFAQChapter 9: C++ References, Sprite Sheets, and Vertex ArraysC++ referencesReferences summarySFML vertex arrays and sprite sheetsWhat is a sprite sheet?What is a vertex array?Building a background from tilesBuilding a vertex arrayUsing the vertex array to drawCreating a randomly generated scrolling backgroundUsing the backgroundSummaryFAQChapter 10: Pointers, the Standard Template Library, and Texture ManagementLearning about PointersPointer syntaxDeclaring a pointerInitializing a pointerReinitializing pointersDereferencing a pointerPointers are versatile and powerfulPointers and arraysSummary of pointersThe Standard Template LibraryWhat is a map?Declaring a mapAdding data to a MapFinding data in a mapRemoving data from a mapChecking the size of a mapChecking for keys in a mapLooping/iterating through the key-value pairs of a mapThe auto keywordSTL summaryThe TextureHolder classCoding the TextureHolder header fileCoding the TextureHolder function definitionsWhat have we achieved with TextureHolder?Building a horde of zombiesCoding the Zombie.h fileCoding the Zombie.cpp fileUsing the Zombie class to create a hordeBringing the horde to life (back to life)Using the TextureHolder class for all texturesChanging the way the background gets its texturesChanging the way the Player gets its textureSummaryFAQChapter 11: Collision Detection, Pickups, and BulletsCoding the Bullet classCoding the Bullet header fileCoding the Bullet source fileMaking the bullets flyIncluding the Bullet classControl variables and the bullet arrayReloading the gunShooting a bulletUpdating the bullets each frameDrawing the bullets each frameGiving the player a crosshairCoding a class for pickupsCoding the Pickup header fileCoding the Pickup class function definitionsUsing the Pickup classDetecting collisionsHas a zombie been shot?Has the player been touched by a zombie?Has the player touched a pickup?SummaryFAQChapter 12: Layering Views and Implementing the HUDAdding all the Text and HUD objectsUpdating the HUDDrawing the HUD, home, and level-up screensSummaryFAQChapter 13: Sound Effects, File I/O, and Finishing the GameSaving and loading the high scorePreparing sound effectsLeveling upRestarting the gamePlaying the rest of the soundsAdding sound effects while the player is reloadingMaking a shooting soundPlaying a sound when the player is hitPlaying a sound when getting a pickupMaking a splat sound when a zombie is shotSummaryFAQChapter 14: Abstraction and Code Management Making Better Use of OOPThe Thomas Was Late gameFeatures of Thomas Was LateCreating the projectThe projects assetsStructuring the Thomas Was Late codeBuilding the game engineReusing the TextureHolder classCoding Engine.hCoding Engine.cppThe Engine class so farCoding the main functionSummaryFAQChapter 15: Advanced OOP Inheritance and PolymorphismInheritanceExtending a classPolymorphismAbstract classes virtual and pure virtual functionsBuilding the PlayableCharacter classCoding PlayableCharacter.hCoding PlayableCharacter.cppBuilding the Thomas and Bob classesCoding Thomas.hCoding Thomas.cppCoding Bob.hCoding Bob.cppUpdating the game engine to use Thomas and BobUpdating Engine.h to add an instance of Bob and ThomasUpdating the input function to control Thomas and BobUpdating the update function to spawn and update the PlayableCharacter instancesDrawing Bob and ThomasSummaryFAQChapter 16: Building Playable Levels and Collision DetectionDesigning some levelsBuilding the LevelManager classCoding LevelManager.hCoding the LevelManager.cpp fileCoding the loadLevel functionUpdating the engineCollision detectionCoding the detectCollisions functionMore collision detectionSummaryChapter 17: Sound Spatialization and the HUDWhat is spatialization?Emitters, attenuation, and listenersHandling spatialization using SFMLBuilding the SoundManager classCoding SoundManager.hCoding the SoundManager.cpp fileAdding SoundManager to the game enginePopulating the sound emittersCoding the populateEmitters functionPlaying soundsImplementing the HUD classCoding HUD.hCoding the HUD.cpp fileUsing the HUD classSummaryChapter 18: Particle Systems and ShadersBuilding a particle systemCoding the Particle classCoding the ParticleSystem classExploring SFMLs Drawable class and OOPAn alternative to inheriting from DrawableUsing the ParticleSystem objectOpenGL, Shaders, and GLSLThe programmable pipeline and shadersCoding a fragment shaderCoding a vertex shaderAdding shaders to the engine classLoading the shadersUpdating and drawing the shaderSummaryChapter 19: Game Programming Design Patterns Starting the Space Invaders ++ GameSpace Invaders ++Why Space Invaders ++?Design patternsScreen, InputHandler, UIPanel, and ButtonEntity-Component patternPrefer composition over inheritanceFactory patternC++ smart pointersShared pointersUnique pointersCasting smart pointersC++ assertionsCreating the Space Invaders ++ projectOrganizing code files with filtersAdding a DevelopState fileCoding SpaceInvaders ++.cppCoding the GameEngine classCoding the SoundEngine classCoding the ScreenManager classCoding the BitmapStore classCoding the ScreenManagerRemoteControl classWhere are we now?Coding the Screen class and its dependentsCoding the Button classCoding the UIPanel classCoding the InputHandler classCoding the Screen classAdding the WorldState.h fileCoding the derived classes for the select screenCoding the SelectScreen classCoding the SelectInputHandler classCoding the SelectUIPanel classCoding the derived classes for the game screenCoding the GameScreen classCoding the GameInputHandler classCoding the GameUIPanel classCoding the GameOverInputHandler classCoding the GameOverUIPanel classRunning the gameSummaryChapter 20: Game Objects and ComponentsPreparing to code the componentsCoding the Component base classCoding the collider componentsCoding the ColliderComponent classCoding the RectColliderComponent classCoding the graphics componentsCoding the GraphicsComponent classCoding the StandardGraphicsComponent classCoding the TransformComponent classCoding update componentsCoding the UpdateComponent classCoding the BulletUpdateComponent classCoding the InvaderUpdateComponent classCoding the PlayerUpdateComponent classCoding the GameObject classExplaining the GameObject classSummaryChapter 21: File I/O and the Game Object FactoryThe structure of the file I/O and factory classesDescribing an object in the worldCoding the GameObjectBlueprint classCoding the ObjectTags classCoding the BlueprintObjectParser classCoding the PlayModeObjectLoader classCoding the GameObjectFactoryPlayMode classCoding the GameObjectSharer classCoding the LevelManager classUpdating the ScreenManager and ScreenManagerRemoteControl classesWhere are we now?SummaryChapter 22: Using Game Objects and Building a GameSpawning bulletsCoding the BulletSpawner classUpdating GameScreen.hHandling the players inputUsing a gamepadCoding the PhysicsEnginePlayMode classMaking the gameUnderstanding the flow of execution and debuggingReusing the code to make a different game and building a design modeSummaryChapter 23: Before You Go…Thanks!Other Books You May EnjoyLeave a review – let other readers know what you think
E-Beletrystyka
biur podróży tui, gmail zarejestruj, wrocław kino, fotowoltaika tauron, ironman dystanse, wyroki naczelnego sądu administracyjnego, surogatka cena, ryczałt od przychodów ewidencjonowanych, nitroerg, schowek, dominik tarczyński
yyyyy