Use C++ libraries

Général

tdelorme

il y a 5 ans

Hello,

I'm starting my first game on Gamebuino and I'd like to use libraries like list. I have problems to include most of libraries using for example #include <list>.

I have to import other packages? Any help would be appreciated .

Thanks in advance :).

Sorunome

NEW il y a 5 ans

The gamebuino meat doesn't work with the stl, so those things won't work!

Instead of lists, try using array? While you can't modify their size, they are often sufficient! What are you trying to do?

tdelorme

NEW il y a 5 ans

That's sad. I 'm coding a snake game. I wanted to use lists to display the snake : put the last position of the head of the snake in a list for each square it would have eaten. So each square would take the same way that the snake's head ( that was my algorithm for the snake's movement, there is probably better way). I can do it with array yes, but I thought this was better.

Sorunome

NEW il y a 5 ans

Actually with a list, with all the dynamic memory allocation, resizing etc. it'll be slower.

The idea is to use an array and have it be "long enough" so that it can fit your data. Instead of holding objects themself you can have the array hold pointers to the objects.

tdelorme

NEW il y a 5 ans

Ok thank you, that was my second idea I'll do this way :)