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

Pages: 1 ... 14 15 [16] 17 18 ... 34
226
It could be related to this, this or this

227
Use the sprite (or any other sf::Transformable) transform

sprite.getTransform().transformRect()

The same works for inverse transforms

https://www.sfml-dev.org/tutorials/2.4/graphics-transform.php

228
Graphics / Re: Simple Map Borders
« on: May 14, 2017, 02:59:07 pm »
Have a look at this post which explains some basic collision testing. There's some sample code at the bottom:

http://trederia.blogspot.co.uk/2016/02/2d-physics-101-pong.html

229
Graphics / Re: sf::VertexArray strange lines
« on: May 11, 2017, 10:44:12 pm »
This is a common problem with vertex arrays (just search the forum for tilemap artifacts).  You can try zooming/moving the camera on rounded coordinates or rendering chunks of maps to a render texture then display that, although my favourite solution is this.

230
There are a couple of articles that might be worth read. This one covers basic collision detection and resolution with SFML. The second one might be useful to apply to your player, so that you can change state when jumping/walking and only apply gravity when in the air. HTH

231
General / Re: Fallens tmxlite question.
« on: April 06, 2017, 10:39:06 am »
Which zip file did you download? If you downloaded one of the releases they contain the prebuilt libs for VS2015. Otherwise if you downloaded the source you have to open the VS project, select the version you want from the configuration manager, then click build. You'll probably have to do this anyway if you're using VS 2017.


232
General / Re: Linking issue in VS
« on: March 30, 2017, 05:14:29 pm »
The compiler you use for your project must match the one you used to compile sfml. Therefore if you want to use visual studio for your project you need to compile sfml with visual studio first, and not mingw. You can use cmake to create visual studio project files rather than make files at the configuration stage.

233
General / Re: Window resize and world coordinates
« on: March 22, 2017, 10:42:24 pm »
This is because your movement is based directly on your frame time. The larger your window the longer it takes to render a frame, and the slower the program updates. Take a look at the fix your timestep article for a good explanation. You're also moving in the middle of a clear/display cycle, when really you should be updating your logic outside of this.

234
General / Re: Tutorial program won't link
« on: March 05, 2017, 10:17:33 am »
sounds like you have subsystem (under linker settings) set to windows. Set it to console, or link to sfml-main (which internally provides a winmain() on windows platforms) if you dont want a console window to appear

235
Graphics / Re: Help with sprite animation
« on: February 26, 2017, 10:15:01 pm »
It's not exactly clear from your post, but assuming the frames are all the same size you can change the origin with setOrigin()

236
SFML projects / DoodleBob - Virtual Pet Game
« on: February 12, 2017, 02:04:48 pm »
This was a project I worked on mostly over the christmas holidays, and have finally got it together enough to put on gamejolt.

DoodleBob is a cross between and perhaps Tamagotchi. Bob lives in his house with his cat Bella, and your job is to keep him fed and entertained whilst managing his income. Bob lives in real time - there is a day night cycle and he continues to live even when the game is not running.



Downloads:
There are windows and linux binaries on the gamejolt page. The source is here on github if anyone wants to try. There's no macOS version as it does not support the compatability context DoodleBob requires.

I'm open to any suggestions for gameplay, although I'll admit this was just a fun holiday project for me so is unlikely to recieve any major updates.

237
Graphics / Re: Problem with the draw & display methods
« on: February 05, 2017, 12:57:52 am »
you only need call clear() and display() once with all your drawing in between (from back to front).

screen.clear();
screen.draw(sp_titlebg);
screen.draw(sp_sfml);
screen.display();
 

238
General / Re: Scene editor for level designing/GUI?
« on: February 01, 2017, 08:52:58 pm »
I'll second Tiled - not just for tile maps. I used it in to create navigation nodes and lay out prop / activity positions.

239
General / Re: Loading all png files from a folder?
« on: February 01, 2017, 05:36:29 pm »
If your compiler supports C++17 filesystem functions are now part of the standard (which you can see here). Slightly older compilers may also provide access via the experimental namespace, and they are all available as part of boost, upon which the std version is based. You can use file_time_type to sort the files chronologically.

240
Window / Re: TextEntered gives me mouse input. Is that intentional?
« on: January 28, 2017, 12:05:48 pm »
if (sf::Event::TextEntered)
 

should be

if (event.type == sf::Event::TextEntered)
 

sf::Event::TextEntered is an enum whose value is almost certainly not 0, therefore will always return true

Pages: 1 ... 14 15 [16] 17 18 ... 34
anything