How to create integer array in cocos2d-x v3


#1

When i create integer and float array using vector , it says Integer is deprecated.

cocos2d::Vector<cocos2d::Integer> arr;

So how i should i create integer array and add elements to it using cocos2d::vector

i dont want to use std::vector as i want to use function getRandomObject() which is not available in std::vector.


#2

You have to use Value.

Why not using the random functions of STL and use that value for the index?


#3

yes you are right, this way is good. can you share one simple example or a link as i am unable to access object at index of array…using std::vector.


#4

Don’t take the trouble, got it done…thanks…


#5

how you have done that?


#6

How did you solve this issue ?