Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


lordimmortal2

Member Since 29 Jan 2011
Offline Last Active Nov 22 2014 08:25 PM

#4979036 Drawing Overlapped Sprites

Posted by lordimmortal2 on 11 September 2012 - 02:12 PM

I'm currently working with DirectX 9 (specifically the 2D portion of it) and would like to draw sprites in front of each other in a particular order.
I have tried drawing sprites from bottom to top and also using the Z coordinate of the draw function, but still nothing.

I'm probably missing something simple, but anyway you can do it with DX9 would be appreciated. Thanks for reading and any replies.


#4939213 Question About Vectors

Posted by lordimmortal2 on 10 May 2012 - 11:49 PM

In addition to my ignorance on templates, I am also pretty dumb on std::vector =P. I can't figure this bug out as I'm not quite sure why it's not working.

TileContainer.cpp:

void TileHandler::AddTile(int row, int column, int rowSpr, int colSpr)
{
	 Tile *tile = new Tile;
	 tile->rowPos = row;
	 tile->colPos = column;
	 tile->rowSpr = rowSpr;
	 tile->colSpr = colSpr;
	 TileContainer.push_back(tile);
}

TileContainer is of type:
typedef std::vector<Tile> TileContainer;

And the error is:
Posted Image

First thought was to mess around and make tile a double pointer, and things of this nature, but nothing worked. If anyone knows what's wrong with it, your answer is very appreciated.


#4826569 Linked List/Entity Spawning

Posted by lordimmortal2 on 22 June 2011 - 02:27 PM

I have been trying to make a top-down shooter just for my own experience and want to finish something. Nothing special.

But, as always, something is barring me from progressing any farther and that would be: entity spawning and dynamic memory. I have never worked with dynamic memory beyond that which is required by multiple file projects so I don't have much experience. I'm looking to replace all the static arrays I had that contained information about projectiles, mobs, and the player into a dynamic linked list. The way I have functions set up is that one function is called for entity spawning, a different one for entity moving, another one for collision and so forth. I do not know how to have one global linked list but have it be accessible in different files and in different functions.

The problem I have ran into, obviously, is the problem of how to actually implement such a list. If someone could post a tutorial or something similar on how to do these I would greatly appreciate it. I have read several on linked lists but they're not too good at explaining exactly how you do it, what each piece does, why it works, and how to implement it yourself.

As always, any reply at all is welcome =).


PARTNERS