Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - TCVM

Pages: [1] 2
1
Audio / Re: Music from buffer
« on: December 21, 2016, 07:09:34 pm »
You have "openal32.dll" in your working directory, right?

2
Graphics / Re: Declaring array of sprites with identical texture.
« on: November 28, 2016, 01:00:29 am »
What's your draw code?

3
General / Re: Deleting RectangleShape pointer crashes window?
« on: October 08, 2016, 02:19:58 am »
You are deleting the object, but you are still drawing it to the window after it gets deleted. This causes undefined behavior, and crashes the program.

4
General / Re: diagonal line with collisiondetection
« on: October 07, 2016, 06:00:27 am »
Box2d is way too powerful if you just need rotated rectangle collision, and no physics. The Seperating Axis Therom is what you are looking for. This is a good guide on how to implement it:http://www.dyn4j.org/2010/01/sat/

5
Alright, thanks for the advice everyone

6
Alright, I think I have figured out what I need to do. So if I need an object to be used in multiple places (logger, input manager, etc), I will use a global pointer to the object which would be defined in a non-global namespace. And the objects that don't need to be accessed by everything (if needed), will be members of another class, probably living in a factory class. Correct me if I am wrong

Thanks for the advice!

7
Alright, I get it now. But what should I do about objects that don't belong anywhere? Let's say the inputManager. It needs to be referenced in completely unrelated parts of the code such as the menu state, game loop, and player. None of these classes are related, but I still need to pass the inputManager to them. Or a logger, it needs to be in virtually every class, but passing around a single pointer seems unneeded.

8
SFML projects / Can someone review parts of my Breakout clone code?
« on: April 21, 2016, 01:45:08 am »
I have just finished my own little polished clone of Araknoid/Breakout, and I was wondering if anyone would mind reviewing parts of my code.

I want to know if my usage of "global" variables is proper. Right now I have a class in globals.hpp that has many public static members of things that I use around my program; resource managers, input managers, etc. Any class that includes "globals.hpp" has access to all of these files. I did this because I really don't want to be passing objects through classes that don't need them just to give them to something else

The other part of my code I want to hear about is my observer pattern. Currently I have an observer pattern with observers and the dispatcher. Many objects inherit from observer and then subscribe to events that can occur. I am wondering if I am using this to liberally, or if it's fine.

Thanks in advance!

Code:
https://github.com/TheCandianVendingMachine/Breakout_TCVM/tree/master/src

Parts in question:
 Globals - game/globals.hpp
 Observer pattern - managers/events
 Use of an observer - states/gameState.hpp

9
General / Re: Fixed timestep CPU usage
« on: February 12, 2016, 11:53:02 pm »
Well, not exactly. If you have a simulation you want to run the same way, every time, a timestep becomes important.

http://gafferongames.com/game-physics/fix-your-timestep/
Don't just read the code, but read the text chunks too. They describe what the code does, and why it is used

10
General / Re: Fixed timestep CPU usage
« on: February 12, 2016, 11:39:05 pm »
If you use setFramerateLimit, it sets the upper bound which window can update at. Can't go above 60 (for example). However, what if your program goes under 60? Then your physics become wrong, and you suddenly have very weird behavior

If you don't setFramerateLimit, it really charges your CPU unnecessary amounts of power. Especially for a 2d program. So it's generally good to use the two combined

11
SFML game jam / Re: Wanna another? (early 2016 edition)
« on: February 02, 2016, 10:55:43 pm »
Make sure when this happens to advertise it on other platforms (I.E /r/gamedev)

12
SFML projects / Re: Zombie Shooter 2000
« on: December 30, 2015, 03:35:50 am »
Thanks for the feedback. About the soundPlayer design - I was going to use a std::unique_ptr, but I thought they would be destroyed as soon as the function ends. I never thought about having a std::vector holding the  sound buffers

I couldn't figure out how to delete the soundBuffers after they stopped playing without having either a dedicated thread for it, or it's own update function. Neither of which sounded good, so I opted for checking for stopped sounds at the front whenever I played another


The arrays are static because I wanted to be able to edit certain variables from other classes without passing in an instance of the object. Now that I am describing what I wanted to do, I just realized many ways I could fix it without static variables

And the textureManager was meant to be used for repeat, random textures. It's just that my art skills aren't the greatest, believe it or not, so I never got around to that

Thanks for taking time to read through the bits of my code I thought was iffy. Really appreciated

13
SFML projects / Zombie Shooter 2000
« on: December 29, 2015, 07:55:48 am »
Hello! I have been trying to get into coding small games for a while now, but I could never get them finished. I have just started coding in C++ in 2012, and created my first "original" game in April. This is my third game I am proud to show off.

If someone could review my use of static arrays in the following classes, it would be appreciated
userInterface.hpp, textureManager.hpp, soundPlayer.hpp


Github: https://github.com/TheCandianVendingMachine/ZombieKiller2000
Compiled Game: https://app.box.com/s/6mql02691rr71uw8szffimup816crw0q

Zombie Shooter 2000 is about you - a triangle on the streets minding his own business until BOOM. Zombie outbreak. Survive for as long as you can, and kill off the endless waves of zombies

14
General / Re: When setting up SFML, produces alot of errors
« on: September 14, 2013, 10:59:39 pm »
Thanks! It now works! Now, for future reference - Copy all DLL's to the executible. I just had to copy the DEBUG dlls aswell. As in sfml-graphics-d.dll.

Thanks for all the help!

15
General / Re: When setting up SFML, produces alot of errors
« on: September 14, 2013, 10:35:15 pm »
Hello again, now when using release it says

Code: [Select]
The program can't start because sfml-graphics-2.dll is missing from your computer. Try reinstalling the program to fix this problem
I have the file in my bin folder, and my folder where the exe is.

Pages: [1] 2