Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Everything posted by Ocarinha

  1. I'm developing an engine for a 2D game in C ++ and for some days I've been looking for a way to protect the images and audio of my future game. I know there is no 100% protection and that someone would be able to open these files, but I mean the regular user who just installed the game, prevent it from modifying the sprites, change the sound, overwrite the xml files with game map data. I downloaded some games made in Unity and noticed that a .assets extension is used, in Diablo 2 it is used .ma0, .mpq, .data, in FEZ .pak, in Super Meat Boy only a .tp file. In other words, you can not open and edit any of these files in a text editor or unzip with winrar, they offer a minimum level of protection. How is this done? Do I have to create my own binary file format or is there any program that makes it easier to work?
  2. But using PhysicsFS I could create a zip, but with another extension (my_file.xyz) preventing it from being opened by winzip for example, or that the user would change to the original name (my_file.zip) and open it?
  3. Genial, this vector makes ??all the difference, thank you Andy Gainey, I was using an ugly hack and ignoring it 
  4. I'm trying to create a collision between two circles (c1: player moves and c2: static object) and put in the shortest possible distance, away when there is overlap. The below code works, but inaccurately because always push horizontally and vertically: http://postimg.org/image/ik15bv6s1/ Does anyone know the right algorithm to do this? var distance = Math.sqrt(Math.pow(c1.x - c2.x, 2) + Math.pow(c1.y - c2.y, 2)); // r1, r2 = radius // Collision test if (distance <= (r1 + r2)) { var distanceToMove = (r1 + r2) - distance; if (c1.x < c2.x) { c1.x -= distanceToMove; } else { c1.x += distanceToMove; } if (c1.y < c2.y) { c1.y -= distanceToMove; } else { c1.y += distanceToMove; } }
  5. I was confused, mixing the image format with your position, but now makes sense, thank you I'll put into practice.  
  6. I'm trying to create a collision system based on tiles. I found some tutorials teaching to find out the tiles that the image will overlap if the image is less than or equal to the size of a tile, but would like to work with figures of any size and shape, for example, which tiles a polygon or circle will occupy in the next move. From this I can test which figures in the tiles that collide with the sprite moving. Does anyone know the algorithm to do this? Thanks
  7. Please have searched endlessly for a tutorial that explains clearly and objectively how to apply the collision detection technique between polygons in a 2D game, but some do not explain how to apply it in practice, others lack information and mathematical concepts used, others yet even comment the code, often complex to decipher what was done. Sites already consulted http://www.codeproject.com/Articles/15573/D-Polygon-Collision-Detection It explains the SAT method, which currently use, but when the collision is between multiple polygons does not work the right way http://www.metanetsoftware.com/technique/tutorialA.html A very good tutorial but lack information and examples http://www.vsoftgames.com/site/files/tecnicas_deteccao_colisao_para_jogos.pdf Excellent tutorial but does not teach how to treat the collision response Can someone explain to me in detail how to use SAT (Separating Axis Theorem) and deal with MTV (Minimum Translation Vector) between multiple polygons or at least what knowledge I need to get? Grateful.
  8. Ocarinha

    2D Polygon Collision Detection

    Thank you very much Sunsharior, the book is very thorough, I've read a few pages. Find a perfect collision system made me lose sleep, but it's like the Aardvajk said, we do our best to simulate reality and "avoid some bugs", but apparently is the same approach for 2D games for even the most famous as Super Mario, Donkey Kong, Sonic, Zelda... use circle collision, bounding box, SAT and pixel perfect, the idea is to understand gradually.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!