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

Pages: [1]
1
System / Mouse event problem....
« on: February 19, 2017, 11:22:29 am »
I have the event loop inside the main.cpp and i have 2 classes  (a game class and a player class) i want the player to shoot if the user presses the mouse. but the only thing i could use was the sf::Mouse::isButtonPressed(sf::Mouse::Left) it works but if you press it just keeps repeating. so i was thinking about using events. but then i need to send it via main.cpp to game.cpp to the player.cpp. is there another way of doing this?

EDIT:
does someone know a good way of sending event data. because now i have a fucntion in the game.cpp thats named SetMouseState(bool state) that sets a value in the game.h called mouseState and i have the same function in the player.cpp that does the same thing. this is really annoying to do it for every single button.

2
Graphics / Drawing is too hard in sfml?
« on: February 18, 2017, 03:08:33 pm »
When i want to draw a simple rectangle i have to create an object for every single rectangle or draw the same object on multiple places is there any other way i can draw.

when i create a class with a draw function i can't just enter  window->draw_rectangle(x,y,width,height) i must create an object inside the class and set all its properties inside the constructor.

i can try to use the same object and change the value's before drawing it but there is no pop() or push() so i would have to reset everything manually.





 :-\

3
System / People messing with my programs.
« on: December 01, 2016, 08:36:04 pm »
I don't want people to see all photo's and data files of the game. because they can cheat and its annoying to send them all one by one. i can put them in a winrar file but not everyone has winrar. so is there a way i can put all
files in the exe file?

Pages: [1]
anything