• Member Avatar
    jkhippie

    Replied To a Post in problem accessing a deque of pointers

    Awesome! Just what I needed. Why couldn't 10 pages of Bing results find that for me? Leave it to a stuffed dog (?) to have the answer. ;-)
  • Member Avatar
    jkhippie

    Gave Reputation to Moschops in problem accessing a deque of pointers

    `i` is not a number. It's an iterator. Either cycle over the deque using numbers: for (int i =0; i< SpriteList.size(); ++i) { SpriteList[i] ... ... } or dereference the …
  • Member Avatar
    jkhippie

    Edited problem accessing a deque of pointers

    #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++ ) { …
  • Member Avatar
    jkhippie

    Created problem accessing a deque of pointers

    #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++ ) { …
  • Member Avatar
    jkhippie

    Began Watching problem accessing a deque of pointers

    #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++ ) { …
  • Member Avatar
    jkhippie

    Replied To a Post in calling member function (static?) from another class

    ![6a619621f3a052655aade91b9b250670](/attachments/small/4/6a619621f3a052655aade91b9b250670.png "align-left") Here you see the player has jumped under the "?" tile which triggered the tile above to display an animation showing the mushroom rising. At the end of …
  • Member Avatar
    jkhippie

    Created calling member function (static?) from another class

    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 …
  • Member Avatar
    jkhippie

    Began Watching calling member function (static?) from another class

    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 …
  • Member Avatar
    jkhippie

    Replied To a Post in Structs vs Classes

    Got it! Seems I was *const*ipated in the brain. Now, as for all those funcs in the base class for dealing with the private data, am nI on the right …
  • Member Avatar
    jkhippie

    Replied To a Post in Structs vs Classes

    Thanks, AD. So I don't need 'const' on funcs that set a value because something changes, right? As I've been learning, I've been encouraged to make things const if possible. …
  • Member Avatar
    jkhippie

    Replied To a Post in Structs vs Classes

    Well, it looks like I'm not quite getting it. Have a look, please... class GridCell // One cell of a 9x9 grid { public: GridCell(); GridCell( int x, int y, …
  • Member Avatar
    jkhippie

    Replied To a Post in Structs vs Classes

    Thanks, vmanes. Sounds like I'll be making the board a class ( for the init and draw funcs ) and leave the struct for matching, just declare a struct object …
  • Member Avatar
    jkhippie

    Created Structs vs Classes

    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 …
  • Member Avatar
    jkhippie

    Began Watching Structs vs Classes

    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 …
  • Member Avatar
    jkhippie

    Began Watching C++ GAME HELP!

    So i have a code for a menu and i am facing some problem.. code:- do { ch = getch(); switch(ch) { case 'W': case 'w': system("CLS"); cout<<" MOD v1.0\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; …
  • Member Avatar
    jkhippie

    Replied To a Post in C++ GAME HELP!

    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 …
  • Member Avatar
    jkhippie

    Replied To a Post in Queue problem using a function append.

    Oops, the size will change, won't it. So then... int sz = Q2.size(); for(int index = 0; index < sz; index+ ) Q1.push( Q2.pop() ); return Q1;
  • Member Avatar
    jkhippie

    Began Watching Queue problem using a function append.

    Question:write a function append that takes as input two queues Q1 and Q2, appends the content of Q2 to Q1 and returns Q1. The protoype of the function is: queue<float> …
  • Member Avatar
    jkhippie

    Replied To a Post in Queue problem using a function append.

    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.