Hi! Thanks for answering. That looks like a good idea but I'd have no idea how to implement it at all. Since I'm not familiar with arrays OR how they'd work to do such a system. Thanks again though. That just means I need to do arrays for the NEXT iteration of this game. Sigh.
Sorry for taking so long to respond, I've been busy.
Okay. I think it's time to call it. The same thing happens with each suggestion I try. So I dunno what the problem is. I'll probably come back to this project again eventually, but I think I'm done being frustrated for a while.
Thanks for all your help @galoyo, I appreciate it!
It will scale to the different resolutions but you might need to account for the physical size. A 10" tablet will have physically large buttons and will be harder to use/reach the buttons. A phone will have smaller buttons and might be hard to use too. We can use openfl.system.Capabilities.screenDPI to calculate the physical size. (maybe there's a HF var already for this?)
Also, the aspect ratios vary from almost square to extra wide screen. So with a squareish screen the vpad buttons might be better along the bottom, while on wide screen it might be better with them on the sides (landscape). 16:9 wide screen seems to be the most popular aspect ratio at this time.
I've yet to deal with all this for my game, but thought I'd share these considerations.
While I did figure something out, I still have a problem. The player tunnels through the terrain as well! This is what I'm doing. I create a map like in BSPMapGenerator. Then I sort of combine it with the SetTileProperties demo. I do it like this:
//When the flxtilemap is created from bspmapgenerator, i give it's tiles these properties
for (v in 1...16) map.setTileProperties(v, FlxObject.ANY, bombHit);
BombHit is just a rename of the function rightHit in SetTileProperties. I then set up everything else. For collisions, I go:
private function removeTile(Tile:FlxTile):Void
map.setTileByIndex(Tile.mapIndex, 0, true);
//Both here need to be FlxObject
private function bombHit(Tile:FlxObject, particle:FlxObject):Void
Again, the problem is tiles are set to 0 whenever the player object hits the tile map too. I've no idea how to fix that.
I need only the particles from the blue emitter to effect the tiles on the tile map and not the player object.
Setting height and offset.y without calling updateHitbox() or centerOffsets() should be enough.
Also I think recalculating the absolute height will be less error prone than changing it relative to the previous value.
If I build a tower, and that tower is destroyed by enemies, remove the tower. Now because it's a tower, I can place a second tower in the same spot of the tower that I lost.
The second function is for an experimental class called GateB. If I build a gateB, and that gateB is destroyed by enemies, it should be removed. The code is the same as the one for the tower. However, I can't build a new gateB in the same spot I lost a gateB.
EVEN THOUGH IT'S THE SAME CODE BUT WITH A DIFFERENT OBJECT.