Skip to content
A 2D game engine written in C++. It's a lone-wolf operation using OpenGL for drawing, SFML for windowing, input and audio, and as many design patterns as what make sense.
C++
Find file
Latest commit 07cbaaf @cjfrisz Changing the ordering of events in the main loop and simplifying the
Clock update in the main loop.

I'm not convinced that this actually changes anything, but the serious
computations by the engine have been moved to the beginning of the
infinite main loop, moving the SFML-related event handling and drawing
to the end. This groups the high-priority computations together since
the engine shouldn't rely on event handling for important,
time-sensitive operations and, of course, drawing is always done last.

Additionally I realized that breaking the float returned from
sf::Window::GetFrameTime() into its integer and fractional parts was
unnecessary thanks to the normalization performed by the TimeStamp
class and so it has been reduced to simply updating the clock in terms
of the frame time given in milliseconds.

One side note to all of this: my reason for making these changes was
to do some slight optimization for the time-sensitive operations so
that they would occur together. I did this because the logic for
calculating elapsed time between events via the Timer interface seems
to be working correctly. However, the printing from TextMove indicates
that the time difference between every second or third event is
negative which of course can't happen. For the moment I'm going to
ignore this sinc it might be an artifact of the I/O for printing
during the events which may be slower than the event firing. However,
should it rear its head again, hopefully I will remember this.
Failed to load latest commit information.
.gitignore
Actor.cpp
Actor.h
ActorCommand.cpp
ActorCommand.h
ActorGL.cpp
ActorGL.h
Clock.cpp
Clock.h
Command.cpp
Command.h
Config.cpp
Config.h
Controller.h
FallBehavior.cpp
FallBehavior.h
JumpBehavior.cpp
JumpBehavior.h
JumpCommand.cpp
JumpCommand.h
LineSegment2D.h
Makefile
MoveBehavior.cpp Removed the timeElapsed argument from the behavior classes.
MoveBehavior.h
MoveDownCommand.cpp
MoveDownCommand.h
MoveLeftCommand.cpp
MoveLeftCommand.h
MoveRightCommand.cpp
MoveRightCommand.h
MoveUpCommand.cpp
MoveUpCommand.h
NoFall.cpp Working out more compiler issues
NoFall.h
NoJump.cpp
NoJump.h
NoMovement.cpp
NoMovement.h
Observer.cpp
Observer.h
Point2D.h
README
Rectangle.h
Settings.cpp Changed Listener to Observer, added a reference to the Subject in the…
Settings.h
Subject.cpp
Subject.h
TextFall.cpp
TextFall.h
TextJump.cpp
TextJump.h
TextMove.cpp
TextMove.h
TimeStamp.cpp
TimeStamp.h Fixing declaration for TimeStamp operator<< exceeding 72 characters.
Timer.cpp
Timer.h
Weapon.h
config.txt
evolverSF.cpp

README

I apologize in advance for anyone trying to use or contribute to this
project. At current, it's a single wolf (myself, Chris Frisz
(cjfrisz@chrisfrisz.com)) trying to design a 2D game engine without
reading about how other people design games in C++. I'm simply trying
to address each design problem as quickly as possible using OOP design
patterns. That said, the master branch should compile, even if the
resulting executable doesn't do much interesting. The included makefile
is fairly self-explanatory, but here's a list of the notable rules:

all: 
	Compiles all execuateable, evolver, along with the necessary
	classes.

run:
	Compiles the executeable and run it.

clean:
	Delete all ancilliary files (emacs backups, core dumps, etc.)
	and object files

clobber:
	Delete all ancilliary files and compiled files (object files
	and executeable)
Something went wrong with that request. Please try again.