- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
- Interests
- Jazz, liquor, and programming
- PC Specs
- AMD E-300 APU 1.3 GHz
5 Posted Topics
#include <memory> #include <deque> void MyFunc { std::deque< std::shared_ptr< Sprite* > > SpriteList; func_to_fill_deque( SpriteList ); for( auto i = SpriteList.begin(), end = SpriteList.end(); i != end; i++ ) { SpriteList[ i ]->spriteFunc(); // doesn't work SpriteList.at( i )->spriteFunc(); // also doesn't work } } void func_to_fill_deque( std::deque< std::shared_ptr< Sprite* … | |
Hi, all. I'm have a class EnemyController with a function Spawn(...) that instantiates a new object of the appropriate type. I want to call Spawn from somewhere like my TileMap class to create a new Enemy in my tile collision method. Here's what I have so far... class EnemyController { … | |
I wrote a game using an array of structs to represent a 9x9 grid. Now I'm re-writing it as a class to '++ it up' a bit and to better understand classes. Part of the game used a seperate struct to keep track of selected board squares (to see if … | |
Re: If you want something to happen when you press <enter> with the code you have (getch() and switch()) you need "case 10:" getch() returns an ASCII character code (search the web for the whole list). <enter> (or "carriage return") is 10. | |
Re: Try this... queue<float> append( queue<float> Q1, queue<float> Q2 ) { for( int index = 0; index < Q2.size(); index++ ) { Q1.push( Q2.pop() ); } return Q1; } |
The End.