robinho
Member
|
how to remove the last object in Memc
How can you remove the last object in a MemC
my code was like this (for removing the balls, i just don't know if it's correct)
if( balls > 20)
{
balls.RemoveLast()
}
is this correct or not?
|
|
06-06-2013 12:56 PM |
|
Rubeus
Member
|
RE: how to remove the last object in MemC
.elms() returns the total number of elements in the container. removeLast() is the best option for removing the last element.
if( balls.elms( ) > 20)
{
balls.removeLast();
}
|
|
06-06-2013 02:02 PM |
|
robinho
Member
|
RE: how to remove the last object in MemC
thank you very much
i knew that i've forgotten something!
and how can you show the balls faster after a time (for example 10 sec.) so that the game becomes more difficult?
(This post was last modified: 06-09-2013 06:06 PM by robinho.)
|
|
06-09-2013 05:19 PM |
|
Rubeus
Member
|
RE: how to remove the last object in MemC
I'm not sure what you mean by the balls stuff, but you can make a timer by adding a float myTimer and add Time.d( ) each frame, and check if( myTimer > 10 ) { /*stuff*/ }.
There's a few different ways to do timers.
|
|
06-10-2013 03:02 AM |
|