World navigation #13
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: EpicKnarvik97/pokemon-cmd#13
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
##Add Tiles
We might need an Action object/enum for each tile, which would be used when onWalk is triggered. Possible actions could be bumb (you bumped against an immovable structure), none, encounter (random chance for pokemon encounter), teleport (caves, houses, stairs, etc.), menuBattle (a menu for fighting trainers), menuShop (a menu for shopping).
The toString() method should return the character representation of the tile.
A tile should have a char or a single character in a string, with the representation to show on the rendered map.
A tile should have an onWalk() function saying what happens if the tile is walked in.
A tile will have a boolean solid which decides if a user can walk on the tile.
##Add Structures
A structure should have getWidth() and getHeight() methods. They should return the width and height of the structure as if it was a perfect square. These methods will be used to check if a structure can fit on the map. A structure could be placed partly inside the outher wall, but the door should still be placed in a valid location. No walkable tiles are allowed in the outer wall.
A structure should have a name used for calling something like generateStructure("Pokecenter", x, y)
A structure should have a two-dimensional array of tiles.
##Add map rendering
A map could have a set enviroment. It would set the default outer walls to trees in a forest enviroment or to stones in a mountain enviroment. It might not matter in an ascii representation, but it would change the message on bumping.
Maps should have both an addTile function and an addStructure function. They should check if it is placeable there, and overwrite whatever is there from before. Items triggered by a player that is not bump or none, should have at least one walkable tile in either direction. walls can overwrite each other to create more interesting structures.
The actual printing of the map should show a portion of the map. We have not yet decided on the size of the interface. We even need to keep the player centered, or make the map scroll at a specified length from the edge of the map in view.
Tiles and Structures should be added to the map in an overwriting fashion. This will make it possible to first create a big grass field, and then place a house on top. A structure should be placed according to a top-left corner with coordinates (x, y).
A map should first be generated as an empty grid with a set size. As a border, a wall structure should be set with a width big enough that even when walking to a corner, we won't face problems.
##Add shop and battle interfaces
When entering a building with a shop, or a battle with a wild pokemon or trainer, the map should disappear and a menu, similar to the one we have now, should appear. When you win a battle or exit a shop, the map should be displayed again. The player should be on the same tile as before the text appeared, or on the last tile before walking on the tile (a must for trainer battles).
##Add trainer encounters
Randomized trainers should be represented as tiles in the world. When walked into, they should start a battle. Their pokemon should be mostly randomized, but might have a set start level based on where they are placed in the world.
##User input
If we can bind keys, or immediately act on something written, but not submitted, that would be the best. If not, we might need something like a scanner looking for wasd. We could read all commands as one; wwwaaasssdddd would take you one space back, but onWalk would be triggered for each individual move. If you bumped into a wall, or encountered something, you would simply stop. Underneath the map, we should have the text: "w = up, a = left, d = right, s = down".