Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

241 Neutral

About sednihp

  • Rank

Personal Information

  • Interests
  1. sednihp

    Power Up Table Tennis Contest

    I'll try and botch something together for this. Haven't done any programming in a good few months. I'll be using SDL 2 and C++, hopefully I can find the time to make something.
  2. The site looks similar in chrome on the iPad too, https://www.dropbox.com/s/t2gf3eguubujmjz/2013-01-24%2006.32.28.png
  3. sednihp

    games for phones

    Note that develop for windows phone 8 (the newest version) you need at least windows 8 pro 64-bit. Which really restricts you to android and windows phone 7. Android is the biggest smartphone OS on the planet so I'd aim for that -it uses Java as well so you're good there too.
  4. sednihp

    Resources for post Console Based C++

    Learncpp.com was a great site for me, goes from the basics to the advanced with good examples and explanations. Although as jbadams says, the best way is to learn by doing. Try making a console game, then look at sdl or sfml and make a pong clone. You'll make mistakes, you'll break stuff but if you stick at it you'll learn a hell of a lot and have a lot of fun (I certainly did)
  5. sednihp

    What games to create first?

    If you're using XNA with c#, look at pong, breakout and blackjack. All are good beginner projects with scope
  6. Bear in mind that when you do erase it removes the element from the vector and then moves every element behind it up one place. If your vector is of any kind of size this rearranging of memory will be a lot slower then the STL way, which moves all the elements to be erased to the end of the vector and then erases everything at the end.
  7. The allegro-md.dll should be somewhere on your machine (c:/windows/system32 probably). When you find it, copy it into your distribution and then it won't be missing when people go to play your game
  8. sednihp

    using shared_ptr

    Instead of using new, use std::make_shared<T> instead, i.e. std::shared_ptr button1 = std::make_shared<GUIButton>(g_width/2-125, g_height/2-125, 0, 250, 100, "(L)oad Default Scenario", updatestate); Make_shared is exception safe and uses the same call to allocate the memory for the reference counting block and the resource itself, reducing construction overhead (and hey, if you're doing something 2000 times you want to do it the most efficient way possible) For more advice on how to use shared_ptr I found the MSDN article excellent (there are equivalent articles on unique_ptr, weak_ptr and general smart pointers as well) If you didn't have to call setShortCut() and setZOrder() I would have recommended emplace_back as well, UIElements.emplace_back(std::make_shared<GUIButton>(g_width/2-125, g_height/2-125, 0, 250, 100, "(L)oad Default Scenario", updatestate)); Which constructs the element in place in the vector
  9. sednihp

    Question about using "Game States"

    I like LazyFoo's state machines article myself: http://lazyfoo.net/articles/article06/index.php
  10. You'd use something like a 'std::vector<Sword*> swords' and then to add to it 'swords.push_back(new Sword())' Just make sure that when you're done with the vector you delete all the memory allocated (iterate through the vector and call delete on each element). If you've got a c++11 compiler (VS2012/GCC 4.7) you can use smart pointers (unique_ptr or shared_ptr) which will handle the memory deletion for you
  11. Cheers guys, seems so obvious to do it that way SiCrane, thanks for that. I'm using vs2012 so I'll have to see if emplace_back is one of the c++11 features that made it in.
  12. I'm currently working on a Fruit Ninja clone using SDL and I want to restrict my fruit to being created at a random x co-ordinate, but so that they fully appear within the bounds of the window (800x600). My current code (which is a work in progress) looks something like this:       fruit.push_back(std::unique_ptr<Fruit>(new Fruit(rand() % (mediaCache.scrWidth() - 50), mediaCache.scrHeight(), mediaCache.getImage("fruit.png"))));     Which creates a new Fruit at a random x position at the bottom of the window (so it can bounce up into it) and gives it an image.   50 is the width of the Fruit, so to ensure the whole Fruit starts inside the window I take it away from the screen width. I can't access the width through a get() method before the Fruit itself is actually created, so is the best way to do this to make the width a public const static member inside Fruit and use Fruit::width instead of 50 or is there a better way?   Thanks
  13. sednihp

    Good habits for game development

      I just came across this the other day. Scott Meyers' range of Effective C++ books are also a great read on best practices
  14. learncpp.com is the best tutorial I've found for C++ on the internet and cppreference is great for a language reference site, both of which helped me massively when learning the language
  15. sednihp

    Beginner - where to start?

    C++ isn't a great place to start if you're not confident in programming. Python is a lot easier place to start, especially as you have a background in it (however small). You can run it with PyGame to make 2D games like Pong, Space Invaders etc. Invent With Python is a good starting point, it will take you through making games with PyGame and has a lot of different types of games in it. Once you feel like you've gone as far as you can with Python, then moving on to C++ will be a lot easier, at which point you'll need SDL or SFML for 2D programming. Once you're happy with your work with those, then you'll want to move onto OpenGL/DirectX for 3D work.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!