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

Pages: [1] 2 3 ... 7
Network / Re: HTML setHost
« on: August 19, 2018, 04:33:42 am »
The next obvious step would be to Google "HTTP status code 301" and understand what it does and what it means and then you can handle it. ;)

Alright I got everything working lol, is there way to get a specific part of the html?

I tried messing around with setField and setBody. They dont seem to work. I know that getBody returns one big string, and one way I know is to read the string and get data from it. Is there a better way or should i just continue with my way?

The optimal method of retrieving such data is by sending a request to a REST API and then using a JSON parser to access the data.

For example:

{"coord":{"lon":139.01,"lat":35.02},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"base":"stations","main":{"temp":285.514,"pressure":1013.75,"humidity":100,"temp_min":285.514,"temp_max":285.514,"sea_level":1023.22,"grnd_level":1013.75},"wind":{"speed":5.52,"deg":311},"clouds":{"all":0},"dt":1485792967,"sys":{"message":0.0025,"country":"JP","sunrise":1485726240,"sunset":1485763863},"id":1907296,"name":"Tawarano","cod":200}

API Documentation:

JSON Parser (header library):

General / Re: knockback to collision
« on: February 20, 2018, 10:58:03 pm »
atan2 will work out the direction in radians, and the conversion to degrees is also provided above. Just work it out twice, one object may be x2 - x1, y2 - y1 and the other will be x1 - x2, y1 - y2.

General / Re: knockback to collision
« on: February 18, 2018, 08:19:39 am »
Sure, knockback 'can' be done quite simply in the traditional platformer/rpg sense. However objects such as cars can be more difficult due to wheel motion and the shape.

On a side note. I recommend reading up on vector maths/motion physics, as it will help with all games you may work on.
Read part 1-3: http://blog.wolfire.com/2009/07/linear-algebra-for-game-developers-part-1/

What kind of objects are needing to collide? Are you requiring knockback like in the platformer Mario, pong bat & ball, cars, perhaps something else?

The simplest form is probably by moving one object in the opposite direction of the other object. You're going to need a motion system for smooth knockback (acceleration, friction, optional gravity):
Code: [Select]
//Non-code example
directionRadians = atan2(y1 - y2, x1 - x2) // Angle between objects, negate the value for reverse direction
directionDegrees = (directionRadians * 180) / PI // If your game uses degrees instead of radians, convert

object1.setDirection(-directionDegrees) // Imaginary motion function for setting the current direction of the force
object1.setAcceleration(30) // Imaginary motion function to set the force's magnitude

If you want to reverse from the collision point, simply work out the positions of each object relative to the collision point, and then use those coordinates as the position.

Feature requests / Re: Plattform independet File Open / File Save dialogs
« on: October 18, 2017, 06:32:43 am »
I'd like to revive this idea, due to the new direction of SFML dev.

A wrapper for something like:

Would make for a good addition, much like the clipboard improvements.

Please do, my character is half a millimetre on my Surface Pro 4. At least the DPI awareness part.

General / Re: SOLVED cannot fin -lsfml-graphics
« on: June 14, 2017, 09:36:20 am »
When you've got some time, I'd build SFML from source. It's quite easy to do. ;)

In my build system I automatically download SFML and have it automatically build for Windows/Linux/Android and all of the architectures supported - On my Linux box. (Cmake cli)

Graphics / Re: One Texture Shared to Multiple Sprites
« on: May 30, 2017, 05:09:40 pm »
Texture is a light object, any references will be just that. There's no need to reuse the same texture object. xD

Feature requests / Re: Vulkan Support
« on: May 23, 2017, 07:26:54 am »
This tutorial for Vulkan shows you how to create a window, display a graphic and a tonne of other cool stuff.


General / Re: SFML shader sample official not working.
« on: May 21, 2017, 06:40:44 am »
Which two examples are not working for you?

What's wrong with it in it's current form? Has something broken due to an update?

Graphics / Re: How to reduce two draw calls into one
« on: May 10, 2017, 07:55:34 pm »
Yeah sure, use a sf:RenderTexture: https://www.sfml-dev.org/documentation/2.4.2/classsf_1_1RenderTexture.php

As it's a sf:RenderTarget you may draw to the texture before drawing the texture to the window. You could draw a texture to another texture if you wanted even.

SFML development / Re: C++ standards
« on: May 10, 2017, 07:49:55 pm »
Could you consider also using r-value moving, using "Type&& val" and "std::move()".

It'd sure save a lot of useless copying for position/proportion/string constructors and setters.

Loop through your zombies and add entries for them into the vertex array - then draw the vertex array. Remember, it's not the long making it slow - it's the individual draw calls with their context switching overheads

Feature requests / Re: Vulkan Support
« on: April 28, 2017, 06:42:04 pm »
Vulkan is future.
Vulkan is future in applications when efficiency is really crucial. In case of SFML it's not. Same goes for CAD–like programs, simple GUI apps (aka file manager etc.) and pretty much anything that works in 2D.

Like mobile devices with underwhelming hardware and limited battery life?

I can't help but think it needs to be implemented sooner or later.. Better Vulkan than Windows exclusive Direct X.

I agree SFML's constructors can be a real pain. Just like when you want to copy one sort of vector to an SFML vector. They should just make it a template as the compiler will figure whether x and y exists. Not to mention data conversions.

Anyway, there's always initialiser lists if you want to construct one with the least amount of syntax.

Pages: [1] 2 3 ... 7