flembobs

Members
  • Content count

    9
  • Joined

  • Last visited

Community Reputation

102 Neutral

About flembobs

  • Rank
    Newbie
  1. Starting in Python: best graphics module?

    I recommend Pygame (http://www.pygame.org). It's a great library that is very easy to use. There's a lot of documentation, including a few free books, to get you going.
  2. A good framework for rapid development

    My personal favourite is pygame. http://pygame.org/news.html But if you want Java, [i]slick[/i] is a good framework. As far as I know you can create applets with it. [url="http://slick.cokeandcode.com/static.php?page=about"]http://slick.cokeand....php?page=about[/url]
  3. Efficient data structure for a maze

    Success! [img]http://i.imgur.com/B7fGx.png[/img]
  4. Free engine for 2d games

    BYOND may be what you're after. (http://www.byond.com/) It's an engine geared around making 2D online tile-based RPGs easily (though it has been used to create all sorts of games). It handles the tile-based mechanics and all the netcode - meaning you just have to build your world. The language it uses is intuitive and there's a great community for code problems.
  5. Efficient data structure for a maze

    [quote name='way2lazy2care' timestamp='1333026440' post='4926325'] With the scope of what we know about the project, a graph may be overkill. It would be more fun to implement imo though :X [/quote] The game I'm making is a simple, no-frills perfect maze game so I think graphs may indeed be overkill. I think they may be useful for something like a rogue-like, which is something I'd definitely like to program in the future but for now I'll keep it simple.
  6. Efficient data structure for a maze

    [quote name='Expert Novice' timestamp='1333001932' post='4926230'] Um I don't know why anyone hasn't mentioned to use one 2d array of tilegraphics, one 2d array of N-S walls, and one 2d array of E-W walls. [/quote] The idea of storing n-s and e-w walls in 2 separate 2D arrays is interesting! Even with graphs there still seems to be the problem of having to store each wall twice (or pointers back and forth between neighbours). I think this method will avoid that. Cheers!
  7. Efficient data structure for a maze

    [quote name='way2lazy2care' timestamp='1332964307' post='4926095'] You could set it up as a graph. Each node would have a N/S/E/W neighbor pointer, and anytime a pointer is null there would be a wall there. You could extend it to have any number of neighbors and then you could generate mazes with very odd geometries, but that might not really be useful atm. You could check out the Boost Graph Library in C++ if that sounds interesting to you. [/quote] I've read about graphs, and it does sound like a good solution. One thing I don't understand is how to prevent cells from overlapping. I want to make a simple 2D maze. Perhaps there's some way to combine the grid method and the graph method?
  8. Built in Functions

    Most languages have online documentation detailing the built-in functions and included libraries. For example, the java docs can be found here: http://docs.oracle.com/javase/1.5.0/docs/
  9. I'm building a simple 2D maze game using pygame. I'm not sure what would be the best data structure to represent the maze itself. So far I'm using 2 classes, [i]Cell[/i] and [i]Grid[/i]. The Grid class is a 2D array of Cells. Each Cell contains 4 variables: [i]w_n w_s w_e w_w[/i], which are boolean flags indicating whether there is a wall in that direction. One problem I can see is that each wall is stored twice e.g. one Cell with w_e set true requires a neighbour with w_w set true. This makes setting the walls up inefficient as when I remove a wall in one cell I have to remove it in its neighbour's as well. Is there a better way to represent the maze? (I'm sure there is...)