first commit

This commit is contained in:
2021-01-29 21:14:20 -05:00
commit b2acceb4b9
78 changed files with 6774 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
/*
* GameObject.cpp
*
* Created on: Feb 11, 2020
* Author: ayoungblood
*/
#include "GameObject.h"
#include "TextureManager.h"
GameObject::GameObject(const char* texturesheet, int x, int y)
{
objTexture = TextureManager::LoadTexture(texturesheet);
xpos = x;
ypos = y;
}
void GameObject::Update()
{
xpos++;
// ypos = 0;
srcRect.h = 40;
srcRect.w = 30;
srcRect.x = 0;
srcRect.y = 0;
destRect.x = xpos;
destRect.y = ypos;
destRect.w = srcRect.w * 2;
destRect.h = srcRect.h * 2;
}
void GameObject::Render()
{
SDL_RenderCopy(Game::renderer, objTexture, &srcRect, &destRect);
}