There's a lot here, so I'm going to just go for the overarching answer, and see if that helps you. Feel free to come back with follow-up questions on or off-list as needed.
You are definitely going to need arrays, dictionaries probably optional. The simplest way to represent a grid is a two dimensional array of something, whether that be a class called "square" with properties, or just variables that tell you what you need to know about that specific location. You're correct about comparing the player's coordinates to that of an object to figure out if they're picking it up, and the way to have multiple objects is, again, to have an array of objects, each of which has a location on the map (or depending on the game mechanic you could just transform the square to an object instead of terrain). Getting into any more detail than this will start going down the rabbit hole of programmer/code style, so give the above a look, and let me know what else you'd like help with, and I'll do my best to explain it. From: Joey G. Sent: Sunday, February 09, 2020 14:13 To: [email protected] Subject: [blind-gamers] Creating a Map in BGT Hello I know I'm so late to the party talking about the very wonderful BGT being discontinued; but here I am, still trying to create my first audio game. I have virtually no one that I can ask questions from, so I would appreciate it if somebody from this group can help me progress in my game development. I managed to reach the part where I successfully created an area, make my character move, and spawn items and put them in the inventory. But there is part of me that I feel the code I've made were elementary and messy; all there is that I can follow right now is the very generous help files included in the engine. But my main question for this post is, How to properly make a map or grid; is it true that arrays and dictionary are needed for the x and y coordinates? I've done only a variable increment if I can describe it right, like when a player moves, x and y will just increase/decrease their values, and if I want the character to pick an object, I'd just compare if the player's x and y are equal to object's x and y. Is this how I should go about this? Or if ever the map is in the form of an array, how to make it so the player's movement will register to that array, or dictionary? The problem I'm having right now is I am unable to spawn multiple items at once, as I only have obj_x and obj_y to hold their coordinates. So I set it to spawn a new one once the item is picked up. Because of this, I cannot put a number of fixed objects like doors and rivers, without hijacking the variables for takeable items. One more thing. If I want the character to go to different parts in the area like a shallow water, a muddy place and change footstep sounds and screen reader announcements, I would have to write a hundred lines of conditional statements to accomplish what I am after. Any suggestion to make this tedious process be simplier? I promise this will be the last for this post. I managed to make my character face a particular direction, but I can't find a decent solution to adjust its x and y increment when it moves towards a direction other than north. Cheers, Joey -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#121725): https://groups.io/g/blind-gamers/message/121725 Mute This Topic: https://groups.io/mt/71115991/21656 Group Owner: [email protected] Unsubscribe: https://groups.io/g/blind-gamers/leave/607459/1071380848/xyzzy [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
