• Advertisement

MarcusAseth

Member
  • Content count

    445
  • Joined

  • Last visited

Community Reputation

73 Neutral

4 Followers

About MarcusAseth

  • Rank
    Member

Personal Information

  1. Multiplayer Pac-man Challenge

    I'll give it a try, thanks for sharing
  2. Multiplayer Pac-man Challenge

    I agree, I wasn't sure if this was going to change to a different more general solution because I still have no idea about how to send input to the ghosts, so I made it the quick and dirty way using the function pointer
  3. Multiplayer Pac-man Challenge

    My idea for the input was to have a map of keybinding with key=SDL_Keycode and value=void(*)() so that I can link the functions to the key and just pass the key pressed to the map and have it call the right thing, code below. I'm not even sure this work since is the first time I try, furthermore since the Ghost are Creature type too, how are they supposed to get inputs? I guess I need to figure out a secondary method to give input to them. Also, does this even work if both players are holding down a key to move ther character? Hopefully an SDL_Event contain info about all the key currently pressed... I'll keep going, but if you guys have any article that can help me/ put me on the right track, I would appreciate
  4. Multiplayer Pac-man Challenge

    Yup, that's pretty much where I learned it from, even though I only did half of the tutorials
  5. Multiplayer Pac-man Challenge

    No engine, I'm using C++ and SDL2
  6. Multiplayer Pac-man Challenge

    I appreciate the suggestion but blogs are really not my thing Unless is a discussion with others and group learning experience kind of thing, there is no point for me in keeping a blog, I'm not the type who watch back on previously done stuff nor expect anyone else going to take their time to watch stuff made by a begginner, and I find sad even just thinking to the possibility of me writing on a blog that noones watch, so I'll pass on this one
  7. Multiplayer Pac-man Challenge

    Got the sprite class implemented (image below), next timer & input How's yours coming guys? Also is ok to post here? Or are we supposed to open a separate topic?
  8. Multiplayer Pac-man Challenge

    I'm the first one who worries about it because wouldn't be nearly as good to succed just by copy pasting other people stuff And that's why I've asked only after I got it working, I don't plan to re-implementing it no matter the answers, my question was only aimed to compare to the way other people do it to gauge the benefits of each methods and learn more out of it I've had briefly thought of hardcoding the specific tyle type into the map as you did, I didn't went that route only because I though would have been kind of painful to change stuff around watching at a table of symbols (since I don't have any visual map editor xD). This is how the map input look:
  9. Multiplayer Pac-man Challenge

    I'm not officially participating because I'm likely to get stucked somewhere along the way, probably when dealing with sound Anyway I've got this so far: The green cells are the "rules" which I still need to input in my massive switch statement to get all the corner looking right, kind of tedious x_x I have a question regarding it: considering my code below, is this the usual way to match the correct tiles frames? Or I'm just doing it the dumbest way possible? (basically brute-forcing it one line at a time)
  10. I actully have both on my pc, though when I purchased them people where talking about "short lifetime of SSD", so mine is used only to run the OS and everything else has to go in the hard drive. I'm just too afraid to break it
  11. Capturing "this" in a lambda function

    No more doubts left on this point, thanks
  12. Capturing "this" in a lambda function

    No that solve functions are standing alone function, but according to what you say the 'this' capture is then needed to access the 'manager.' which is a member variable of the Game class (the code snippet is from a member function of the Game class). Makes sense, thanks Follow up question is, is capturing 'this' the only way or he could have directly captured the member variable needed, in this case [&manager](){}
  13. Hi guys, I'm having some trouble understanding what this code is doing, can you give me a hand ?_? Code by Vittorio Romeo, you can find the whole thing here So the part I'm having trouble with is this one: // Another useful method will allow the user to execute arbitrary // code on all entities of a certain type. template <typename T, typename TFunc> void forEach(const TFunc& mFunc) { // Retrieve all entities of type `T`. auto& vector(getAll<T>()); // For each pointer in the entity vector, simply cast the // pointer to its "real" type then call the function with the // casted pointer, dereferenced. for(auto ptr : vector) mFunc(*reinterpret_cast<T*>(ptr)); } and // The game logic is now much more generic: we ask the // manager to give us all instances of a certain game // object type, then we run the collision functions. // This is very flexible as we can have any number // of balls and bricks, and adding new types of game // objects is extremely easy. manager.forEach<Ball>([this](auto& mBall) { manager.forEach<Brick>([this, &mBall](auto& mBrick) { solveBrickBallCollision(mBrick, mBall); }); manager.forEach<Paddle>([this, &mBall](auto& mPaddle) { solvePaddleBallCollision(mPaddle, mBall); }); }); I get that forEach<T>(Tfunc) retrieves a vector<BaseClass*>& ,casts every element in it from the BaseClass pointer to a T* and apply the TFunc passed to them, but I kind of get lost, I mean why the lambda passed to it is capturing [this], and even what is [this] in that context...?! Is it the Game class that owns the manager data member? Or 'this' is becoming something else inside the forEach function (meaning that it acts inside of it since is a template argument, capturing the "this" inside of forEach, which I believe should be the manager itself?). And then, I don't see 'this' used anywhere, so...just very confused. Can you help me understand?
  14. Thanks, that was easier than expected! Also I bet the fact you have VSC on SSD is a major factor, mine is on the hard drive x_x Regarding VSC styles I don't like the fact that they only change the interior of the editor and rarely match the surrounding of the IDE, and even though VSC Themes plugin solves it the default themes it comes with are not so great (compared to VS Code) and I failed to find user made themes packs online. Also the visual simplicity of VS Code is a factor for me, VS Community clutter my brain with too many panels x_x Many reasons Anyway thanks
  15. Yes, I'm using Visual Studio Code, not Visual Studio Community. The reason is it's VERY fast to launch and vastly superior color themes (in my opinion) compared to VS Community I'd rather spend a week sorting this out once and for all than waiting 15-20sec every time I double click on VS Community...I just need to sort out this compilation matter and then I'm never going back to VS Community By the way if is a time consuming to explain process no need to explain it to me, pointing me in the right direction (maybe a link) will do
  • Advertisement