Re: Please help me with bgt

Here's a rough idea for you:
Create a map class that:
*holds a two dimentional array with enough space to store a number for each tile which will exist in your map. So if your map is 100 by 100 squares, then you'll create an array of 100 arrays, each containing space for 100 integers representing what is found at that location (wall, grass, stone, etc).
*A method which can tell a player, npc, enemy or other actor class whether or not it's possible to walk on the requested square. For example: if(map.getTile(x, y) != WALL) stepTo(x, y);
*A method which can save the contents of the arrays to a file. This is one of the tricky parts but it can be handled in a few different ways. You can use BGT's dictionary and serialize/deserialize functions to do a lot of the heavy lifting, which will be fast but it'll output rather large map files unless you can get creative with how to represent your data (I'd just get something working first befor e you worry about this).
*A method which can load the saved data back into the arrays in the exact same way it was originally stored.
As it sounds like you're just starting out with BGT, remember as you learn that programming is really about taking large problems (like how do I create a map) and breaking them down into many, very small sub-problems.
To give a real world but simple example: lets say the (big) problem we want to solve is, how do I eat a slice of pizza? Now let's break it down into smaller steps:
*Lift hands.
*Locate plate which contains pizza (which in itself could be broken down into many steps).
*Move hands to previously discovered location.
*Lower hands until they touch plate.
*Grasp hands around pizza.
*Lift hands again.
*Move hands to location of mouth.
*Open mouth.
*Use teath to grasp pizza.
*bite.
*open and close jaw until pizza is reduced to tiny pieces.
*swallow.
*repeat until finished.
This is the way in which you need to think about programming tasks in order for them to seem less daunting.
so to give you general information:
Make sure you understand how to work with arrays (access them, loop through them, resize them, etc). Make sure you know how to use the file and dictionary objects (or objects in general). and feel free to ask when you're stuck. This way, big picture problems like what you're trying to solve will start to make more sense.

_______________________________________________
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : jonikster via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Trajectory via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Trajectory via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Trajectory via Audiogames-reflector

Reply via email to