Sergey Gromov wrote:
> Fri, 14 Aug 2009 13:55:18 +1000, Daniel Keep wrote:
>
>> void dropElement(T)(ref T[] arr, size_t i)
>> {
>> assert( i < arr.length );
>> arr[i] = arr[$-1];
>> arr = arr[0..$-1];
>> }
>
> I think it's important to erase the last element after the move to make
>
Fri, 14 Aug 2009 13:55:18 +1000, Daniel Keep wrote:
> void dropElement(T)(ref T[] arr, size_t i)
> {
> assert( i < arr.length );
> arr[i] = arr[$-1];
> arr = arr[0..$-1];
> }
I think it's important to erase the last element after the move to make
sure no dangling references to unused
Daniel Keep Wrote:
>
>
> Michael P. wrote:
> > Okay, so I'm making a breakout type game in D. Using Derelict.
> > I have a 2d array of Block type variables(not important what's in them)
> > declared like this:
> > Block[][] level;
> > and later load into like this:
> > level = loadLevel( "level
Thu, 13 Aug 2009 22:59:37 -0400, Michael P. wrote:
> foreach( Block[] ba; level )
> {
> foreach( Block b; ba )
> {
> if( checkCollision( ball, b.p ) )
> {
> //remove the block??
> }
> }
> }
I like Daniel's answer be
Michael P. wrote:
> Okay, so I'm making a breakout type game in D. Using Derelict.
> I have a 2d array of Block type variables(not important what's in them)
> declared like this:
> Block[][] level;
> and later load into like this:
> level = loadLevel( "levels.txt", levelNumber );
> Anyways, what
On Thu, Aug 13, 2009 at 10:59 PM, Michael P. wrote:
> Okay, so I'm making a breakout type game in D. Using Derelict.
> I have a 2d array of Block type variables(not important what's in them)
> declared like this:
> Block[][] level;
> and later load into like this:
> level = loadLevel( "levels.txt"
Okay, so I'm making a breakout type game in D. Using Derelict.
I have a 2d array of Block type variables(not important what's in them)
declared like this:
Block[][] level;
and later load into like this:
level = loadLevel( "levels.txt", levelNumber );
Anyways, what I want to do is that when the bal