Unnamed Fish Game BloggPost 2
|
Today we had two Interesting lectures from Ernest Adams and Adam Mayes. This cover the some of the mayor principles of how to create games and how important it is to test if it will be fun. The lecture covered 5 types of Core Mechanics – Physics – Economics – Progression – Tactic Maneuvering – Social Interaction And how important it is for programmers to create a way for the Game Designer to make changes in the game without having to go to the programmers asking, can you compile this for me. The lecture also covered how important Internal Economy is for games. That they most often have a resource, a source and a drain. but also that there are some things that does not have all of them, with sports examples, such as basket ball where your score would just be a resource that goes up without a drain. While the time of the basketball match only has a drain and no source for getting more of it. During yesterdays sprint planning I took on working with the State Manager, States and Core classes. I can gladly say these are now working and are inside the foundation of the fish game. just waiting for Oscar to do the Quality Assurance of it. But in order to get here there were some problems I ran into that needed to be worked around. Creating the State.h and GameState.h/cpp and State Manager went quite smoothly by using the platformer-code as a template. However the Core was not going as easily, as the include in stdafx.h did not include the core.h inside the core.h due to pragma once, but the time it took for me to find this out was most likely more than it should have. resulting in my Core.cpp looking like this.
#include "stdafx.h"
#include "Core.h"
//using namespace sf;
Core::Core()
{
m_bRunning = false;
window = nullptr;
m_fDeltaTime = 0.0f;
}
Core::~Core()
{
Cleanup();
}
bool Core::Initialize()
{
//window (VideoMode(1024,640), "MEGA FUCKING AWESOME SUPER GAME");
window = new sf::RenderWindow(sf::VideoMode(1024,640), (string)"MEGA FUCKING AWESOME SUPER GAME");
if (m_StateManager.GetCurrentState() == nullptr)
{
m_StateManager.Attach(new GameState());
m_StateManager.Attach(new OptionState());
m_StateManager.Attach(new StartState());
m_StateManager.SetState("GameState");
}
return true;
}
void Core::Run()
{
while (window->isOpen())
{
sf::Event event;
while (window->pollEvent(event))
{
if (event.type == sf::Event::Closed)
{
window->close();
}
else if (event.type == sf::Event::KeyReleased)
{
// InputManager::OnKeyboard(event.key, true);
}
else if (event.type == sf::Event::KeyPressed)
{
// InputManager::OnKeyboard(event.key, true);
}
}
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Escape))
{
window -> close();
}
/* if (Mouse::isButtonPressed(Mouse::Button::Left))
{
window.close();
}
*/
sf::CircleShape shape(10.0f);
window -> clear(sf::Color(0x11,0x22,0x33,0xff));
window -> draw(shape);
window -> display();
}
}
Problems I ran into was also the part where with using Git Hub while being four programmers, but to be fair this has gone much better than expected and just one minor conflict and miss commit so far. that was easily solved with the one doing the commit asking if he had done it properly. The problem was fixed before it did any harm.
|