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

Pages: 1 2 [3] 4 5 6
General / [SFML 2.0] Collision
« on: February 21, 2012, 11:28:39 am »
* GetSubRect(): use GetGlobalBounds() taking in account the transformations. GetLocalBounds() for to ignore the transforms.
* TransformToLocal() can now be done transforming a point using the inverse matrix ( sprite.GetInverseTransform().TransformPoint(p) )
* TransformToGlobal() same as above but with GetTransform(), not the inverse
* GetPixel() is still on Image class. If you use textures, first copy the texture to a image using CopyToImage()
* GetSize(), GetWidth(), GetHeight(): use the methods provided by the Texture class GetWidth() and GetHeight()

Window / Collision Detection 2.0
« on: February 06, 2012, 09:31:43 pm »
Totally agree with the last 2 answers =)

Window / Collision Detection 2.0
« on: February 06, 2012, 05:29:42 pm »
Checking every pixel of a image can be an expensive operation. So programmers usually use a boolean bidimensional array to keep the information about the pixels.

Code: [Select]
bool **mask;

You would have to check every pixel and check its transparency, this way you can set pixel
  • [y] to 1 or 0. Then only you have to check the 2 images comparing the masks each other.

The generation of the matrix can be expensive so you should do it when starting or loading the game.

Graphics / Need Help with simple bouncing collison/math
« on: February 03, 2012, 03:51:32 pm »
(Supposing that you are working with "balls")

Velocity is calculated with:

m = mass
u = last velocity
v = new velocity

Note that these last operations are with vectors. (Velocity is a vector, speed is scalar)

EDIT: Sorry that's for one-dimension, check this on wiki pedia for 2D and an example:



General / Distributing SFML games on other websites.
« on: January 29, 2012, 06:00:57 pm »
Quote from: "Viruses"
Ok guys listen. The only thing i care about is that they can't CHANGE my ART assets and then play in MY SPECIFIC game with assets that they changed. For example, lets say im desiging a space shooter and i have bullets. Well the bullets are going to be sprites. So i made collision detection that if the bullets hit the enemy they die. Now listen. All they have to do is go into the directory of my game, look for the bullet sprite, change it so that it fills the entire screen or watever, and then when they shoot all enemies die because of the collision detection. I want my ART ASSETS LOCKED. You guys are thinking about copyright and people stealing my work. I just don't want my game to be played differently then its supposed to. I want to make sure it plays the way its supposed to with the assets that i created. Like, earlier i told you that in this game i had downloaded, they had the maps and models in dll files so there was nothing i could do to change the maps or models. I want to do something like that. In other games i've seen files with changed extentions.

You don't have to use the image size as bounding box collision, just use a constant boundingBox size independent from the image size.

General / Distributing SFML games on other websites.
« on: January 28, 2012, 01:31:43 pm »
Use xor encryption with each byte.

Code: [Select]
A xor B = C // encrypt
C xor B = A //decrypt

You can use B as your password for your encryption.

System / IsKeyPressed seems to not fire all the time.
« on: January 26, 2012, 11:55:05 pm »
Read about the keyboard buffer
Most keyboards are not designed to handle mor than 3 (or 2) keypresses at the same time.

There's nothing you can do in your code to solve that, just buy a gaming keyboard or a joystick.


Network / how does a client find a computer running the server
« on: January 25, 2012, 12:25:25 am »
Quote from: "JayArby"
Ah, good! So what is the broadcast address?


Graphics / Is it possible to draw FloatRects to the screen?
« on: January 22, 2012, 07:56:30 pm »
Quote from: "Elgan"

Omg, I have not noticed about that class until now :lol:
Sorry, anyway it's a sf::Shape based class.

Graphics / Is it possible to draw FloatRects to the screen?
« on: January 22, 2012, 07:38:19 pm »
If you are using SFML 2 you can use sf::Vertex class. If not, I think that sf::Shape is the unique option (unless you use openGl directly).

General discussions / New naming convention
« on: January 22, 2012, 07:29:43 pm »
Quote from: "Tex Killer"
I never use the standard library at all... But anyway, it is pretty clear that the huge majority of users prefer changing to camelCase.

What about a poll?
Anyway it's up to you, Laurent :)

General / Distributing SFML games on other websites.
« on: January 22, 2012, 07:25:34 pm »
Quote from: "Tank"
I suggest to concentrate on more important things, like creating a good and working game. And something to think about: If your users are *able* (by design) to change things, doesn't that also mean that your product may get better without any work? Just look around and find games that are being played and enjoyed for many many years. The majority of them is modificable.

That's right, I have never sold any game, but I can guarantee that one of them (specifically Dbzbx wich I made in GameMaker) is still at the present played so much. Why? It's highly editable and people use to make their own versions of it.

Sell the game itself online, you can read this amateur and nice article. It'll give you some starting point, but note that for now you will have to MAKE a good game.

General discussions / New naming convention
« on: January 21, 2012, 02:34:50 pm »
Quote from: "Ceylo"
Plus, if SFML should change its naming convention, it's now or "never".

Completely agree.

Graphics / Rect.Intersects trouble
« on: January 19, 2012, 02:34:29 pm »
There must be something wrong in the project configuration, that code just works well for me with SFML 1.6 using CodeBlocks and MinGW

General / Multiple inheritance
« on: January 18, 2012, 09:44:01 pm »
Yes, that's a nice solution. I wanted to know your opinions, so I'll try to implement the shape as a member for now. In fact, I wanted to avoid the use of multiple inheritance.

Thank you very much!

Pages: 1 2 [3] 4 5 6