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 - Abragon

Pages: [1]
1
General / Re: Structure syntax
« on: October 23, 2017, 11:39:28 pm »
Thanks for the heads-up  ;D!!!

2
General / Structure syntax
« on: October 23, 2017, 12:22:06 am »
I am going through the SFML game development by example book and in this chapter they have an advance structure that I would like some help on.
struct Binding {
   Binding(const std::string& l_name)
      : m_name(l_name), m_details(l_name), c(0) {}
   void BindEvent(EventType l_type,
      EventInfo l_info = EventInfo())
   {
      m_events.emplace_back(l_type, l_info);
   }
   Events m_events;
   std::string m_name;
   int c; // Count of events that are "happening".
   EventDetails m_details;
};


particularly of interest is the 2nd and 3rd line after the header. I am not sure exactly what is being declared.

3
I ran into the same problem. Could you show the insert?

4
General / Re: Using sf::texture and sf::sprite
« on: October 11, 2017, 11:17:22 pm »
Thank you so much because that fixed it. It was suppose to be an assignment(= v ==). You're great!

5
SFML game jam / Re: A Tilemap Series
« on: October 04, 2017, 02:56:03 am »
Found a decent source albeit in German the code is in English. Includes source:https://www.youtube.com/watch?v=ZTuPcPWGVBc

6
SFML game jam / A Tilemap Series
« on: October 04, 2017, 12:16:00 am »
Hello all , I've been wanting to start a definitive series for creating TileMaps with SFML but my resources are few and far in-between. Is there any way the community could point me to any resources? I am wanting to obtain a solid background and I think this project would be a great help

7
General / Re: Using sf::texture and sf::sprite
« on: October 02, 2017, 11:13:25 pm »
Update: When I add only one of the counterWalking I get the dissapearing bug but if I keep the other directions starting at 0 then it reappears where the faulty input should have been. From this I believe that the dissapearing still keeps the position .

8
General / Re: Using sf::texture and sf::sprite
« on: October 02, 2017, 02:03:59 am »
I tried adding a window.setFramerateLimit(60) but no change.If i sub the keyboard texturerects with 0 I get the familiar png movements but I fail to add the increment counter

9
General / Using sf::texture and sf::sprite
« on: October 01, 2017, 11:42:17 pm »
Hi all, Hoping to get some help with an issue I get while trying to follow a tutorial series on youtube. I'm trying to create an animation using a 576x256 .png in each direction but my sprite disappears when I do input. Any help on this would be greatly appreciated.Here is the following code:
#include <SFML\Graphics.hpp>

int main()
{
   sf::RenderWindow window(sf::VideoMode(1000, 800), "SFML works!");
//   sf::CircleShape shape(100.f);
//   shape.setFillColor(sf::Color::Green);
   float playerMovementSpeed = 1;
   int walkingCounter = 0;

   sf::Texture texturePlayer;
   texturePlayer.loadFromFile("walksprite.png");

   sf::Sprite spritePlayer(texturePlayer);
   spritePlayer.setPosition(window.getSize().x / 2, window.getSize().y / 2);
   spritePlayer.setTextureRect(sf::IntRect(0, 0, 64, 64));
   while (window.isOpen())
   {
      sf::Event event;
      while (window.pollEvent(event))
      {
         if (event.type == sf::Event::Closed)
            window.close();
      }

      window.clear();
      if (sf::Keyboard::isKeyPressed(sf::Keyboard::W))
      {
         spritePlayer.move(0, -playerMovementSpeed);
         spritePlayer.setTextureRect(sf::IntRect(walkingCounter*64, 0, 64, 64));
      }
      if (sf::Keyboard::isKeyPressed(sf::Keyboard::S))
      {
         spritePlayer.move(0, playerMovementSpeed);

         spritePlayer.setTextureRect(sf::IntRect(walkingCounter*64, 64*2, 64, 64));
      }
      if (sf::Keyboard::isKeyPressed(sf::Keyboard::A))
      {
         spritePlayer.move(-playerMovementSpeed, 0);
         spritePlayer.setTextureRect(sf::IntRect(walkingCounter*64, 64*1, 64, 64));
      }
      if (sf::Keyboard::isKeyPressed(sf::Keyboard::D))
      {
         spritePlayer.move(playerMovementSpeed, 0);
         spritePlayer.setTextureRect(sf::IntRect(walkingCounter*64, 64*3, 64, 64));
      }
      walkingCounter++;
      if (walkingCounter== 8)
      {
         walkingCounter == 0;
      }
   //   window.draw(shape);
      window.draw(spritePlayer);
      window.display();
   }

   return 0;
}

10
General / Procedural Generation Algorithms &//w// Tile Engine
« on: September 11, 2017, 12:19:17 am »
Hello all :) I am continuing my investigation into an exact code solution on the project I've been working on. I am trying to add procedural generation by first creating a checkerboard pattern and then connecting outside points using a recursive backtracking algorithm (code exerpt can be found here: https://stackoverflow.com/questions/46146002/manipulating-sfml-vertex-array).
 I have the grid loop implemented but I am struggling in making a boolean check for the tile type. I would like to add a type function but I'm using the vertex array notation and I'm not sure how to manipulate the quads. Any pointers or examples would be greatly appreciated!

Pages: [1]
anything