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.


Topics - devilswin

Pages: [1]
1
It feels to me that the key bind system the have in the book  (when i click up, move the plane up) seems very unresponsive at times, or too sensitive at times. Like if i hold down left for 2-3 seconds, release left then hold down right, the plane wont move. is there a better way of doing this?

2
So I am using the majority of the book's systems for my version of pong. However for my version of pong, I want to have a level system that has a countdown timer, and when the timer hits zero, a state is pushed that has a timer that says new level. Then in the gamestate, a class that has the attributes of the level increased.  I tried doing this, but the issue us that even though the pause state  or the new level state was pushed to the top, the sf:clock is still running, thus making this new state useless, as the level can end if the player sits in the pause screen for a given amount of time. I am on my phone posting this so I do apologize

3
So i will try and be a specific and thought out as possible with this.

I do not know the technical term for the thing that i am asking about but i will go into as much depth as possible

So on the left hand side there is a side bar of sorts with different game elements such as a box, an enemy sorter, etc. With that sidebar you can add new elements, say if i want to make a car element, i click a little plus. After clicking, i can choose what base class the object is and then what the name of it is, and other options i feel i need. Then from there it will generate a .cpp and a .hpp that i could edit with an ide. another functionality that this sidebar would have is that i can drag and add elements to the scene, create maps, and other stuff with those elements. The main part of the window will be a scene, if it was a scene of a world, it would look like a map. From that map i can rearrange aspects to my liking and create new areas. After i finish editing, i can save it as a .txt and all of the map will have a specific ID to the block/thing so that the game can read through and build the world.

Is there anything like this that exists?
How would you go about doing this?

4
So with regards to the sfml game dev book, i find myself trying to recreate what has already been created because i am not as proud when i use other people's code. With the book in mind, i don't want to make a game with the base classes that are crucial to the "engine of the game". Some of those classes are like the application, gamestate (other states) worlds. The other "Base classes" such as state, scenenode and sprite node, command, command queue, state stack, and the others that are the base classes. This requires me to require WAY more time trying to come up with a better way of doing what the classes for the engine do. By doing this, i rarely get stuff done, and generally lose interest in continuing my work.

Any tips? Or a reason to use open source code?


On a separate note, does anyone have an already built package of Thor for mac? can't get it to install

-Gabe

5
Just to give a little background, i have always struggled with reading comprehension. I have read 60% of the SFML game development book. I find that while reading, the code makes sense to me. but when i try to implement it, i struggle with trying to remember how they are implemented or how they work. I find that i learn best from videos, because i can visualize them and see what is actually going on.

I know that this forum is very critical of codingmadeeasy's videos. But the other side of this is that he is the only one who makes video tutorials on SFML. So i was wondering if anyone knew of any other video tutorials for SFML.

6
General / [SOLVED]Error with SFML game development book
« on: February 02, 2015, 07:33:50 pm »
So at the end of chapter 4 i get this error when trying to compile. It is in command.hpp that the error is being reported, but it is being called in player.cpp.

Command.hpp
#ifndef COMMAND_HPP
#define COMMAND_HPP

#include "Category.hpp"

#include <SFML/System/Time.hpp>

#include <functional>
#include <cassert>



class SceneNode;

struct Command
{
                                                                                                Command();

        std::function<void(SceneNode&, sf::Time)>       action;
        unsigned int                                                            category;
};

template <typename GameObject, typename Function>
std::function<void(SceneNode&, sf::Time)> derivedAction(Function fn)
{
        return [=] (SceneNode& node, sf::Time dt)
        {
                // Check if cast is safe
                assert(dynamic_cast<GameObject*>(&node) != nullptr);

                // Downcast node and invoke function on it
                fn(static_cast<GameObject&>(node), dt);
        };
}
#endif // COMMAND_HPP

 

Command.cpp:

#include "Command.hpp"


Command::Command()
: action()
, category(Category::None)
{
}

 

Where it is linking in player.cpp
void Player::initializeActions()
{
        const float playerSpeed = 200.f;

        mActionBinding[MoveLeft].action  = derivedAction<Aircraft>(AircraftMover(-playerSpeed, 0.f));
        mActionBinding[MoveRight].action = derivedAction<Aircraft>(AircraftMover(+playerSpeed, 0.f));
        mActionBinding[MoveUp].action    = derivedAction<Aircraft>(AircraftMover(0.f, -playerSpeed));
        mActionBinding[MoveDown].action  = derivedAction<Aircraft>(AircraftMover(0.f, +playerSpeed));
}
 


Source Code for the book:
https://github.com/SFML/SFML-Game-Development-Book

This is from chapter 4


The exact error is:
Command.hpp:32: error: type 'const AircraftMover' does not provide a call operator
                fn(static_cast<GameObject&>(node), dt);
                ^

7
Hello, I was wondering why at certain points, when comparing the downloadable source code to the code i have written, i appear to be missing numerous things. Like in chapter 3:
  • When does the book say to make the resource identifier file?
  • Also, when does it say to make the string helper class?
  • Why does it seem that i am always missing includes and other things that are important?

8
General / Questions on the SFML game development book
« on: January 05, 2015, 08:37:38 pm »
Hello,
I was wondering if anyone could answer any of the following questions that i have about the content in the SFML game development book up until the tiling section in chapter 3:
  • What is the purpose of having SpriteNode class when it basically has the same source code as all other classes?
  • Why does it seem like there is numerous unnecessary explicits and virtual functions that could be avoided?
  • It may have been explained in the book, why is there numerous "Holder" classes that do what appears to be the same thing?

9
General discussions / SFML cookbook?
« on: December 09, 2014, 05:03:47 pm »
Hello, I saw a C++ Cookbook and some others for other languages and was wondering if there was anything that resembled a cookbook for SFML?

10
General / [SFML 2.1] Sprite animation not playing
« on: December 04, 2014, 06:07:16 pm »
Hello, I am wondering how, with the program i have at the movement, to move the character who is smaller than the size of each tile to the end of the tile. At about line 512 in the main.cpp is where i move the sprite in a loop. The issue is that the animation does not play when he moves. It is chopped up and looks like he is flying across the map. I was wondering if anyone knew a fix or a better way to this. Whenever i use the sprites getLocalBounds() my program gets numerous memory leaks. I am using an Animated Sprite by Laurent Gomila to animate the sprite.

My code: https://github.com/devilswin/path_finder
Edit: Scroll down to other replies to find shorter amounts of code

Pages: [1]
anything