Here is my game. I was just wondering if there is any way I can simplify this with functions? I made this entire thing without realizing that there was a functions tab, and I get the premise of how it works, but I don’t want to mess anything up because it already works well as is.
I mean… you could use functions, or you could just simplify your code a bit. When you make your tile map, create a banana tile. For element value of array of all (banana tile) blocks locations, create a banana. No need for any of this banana1 stuff. Then when you are drawing to minimap, for element value of array of all sprites of kind (whatever your banana sprite type is). Then in your loop draw value on minimap. The same thing can be used to do your gorillas. Tell me if this helps, it should massively reduce the code, and thus the lag in the editor, allowing you to build the game more.
I think I understand what you are talking about, but with the bananas I did that so that the map updates when each banana is created or destroyed, so I had to separate them all. This was the method I found, so that they all acted independently. I never understood the array stuff, so if there is a method like you are saying that would be great! I don’t understand what you were trying to say 100% though. I’m just trying to find the way to simplify it as much as possible so I can add more blocks and stuff for more levels and all that. So, thank you!
This is what I mean. Sorry for the earlier confusion. Just this but with the bananas. See how I have dragged down the value thing from the top? This code iterates through all the locations, and runs this code for every block. For writing to mini map, you just need to do this for all of the sprites, then draw value on the mini map.
I see that, although, because of how my tilemaps are made, it wouldn’t ever be centered because each passageway is 2 tiles thick. Would I have to change my tilemaps?
You could change the banana’s x by a certain amount, say 8, then put all banana’s on the right. Or, have 4 tiles and do this for all of them, that way it says which way to move it. Sorry for the unclear explanation, if you get this working it could make new levels much easier to build!
I think I understand it then, I make the sprite place on a certain tile, but I just find a way to offset it and it will line up properly. Thanks!