Timeline for LibGDX - Level management on a level-based game
Current License: CC BY-SA 3.0
4 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Nov 16, 2015 at 23:12 | comment | added | Francisco | Hey, i did try using trig but the values i was getting weren't matching the ones i tried manually :( Like, manually a block would start at let's say x= 110 but using trig the value would be like 85. Not quite sure why to be honest, but i will try it out again for sure, thank you so much. | |
| Nov 16, 2015 at 23:05 | comment | added | spectacularbob | You can use Trig to calculate this. If you know the x,y rotation, and the length of the rectangle, then you can calculate its other endpoint by endX = x + cos(rotation)*length and endY = y + sin(rotation)*length If you want, you can even specify in the XML that some blocks have relative positioning and you can calculate this when you load the level | |
| Nov 16, 2015 at 22:34 | comment | added | Francisco | Hey, thank you very much for the answer! That does look like quite a good way to do it; i still remain with one question though: what would be best way to tell the x and y values of the blocks considering one block would start where the other block ends? I've tried some stuff, but the fact that each block has it's own rotation / height is making it a bit difficult... :( (I know this isn't really related to the question, but any help would be highly appreciated) i.gyazo.com/df8046a3879d3a90374d82de2c7c7867.png | |
| Nov 16, 2015 at 21:42 | history | answered | spectacularbob | CC BY-SA 3.0 |