Tower Defense Template for Sale!

Hi Maroun,

The logic code in the menu.lua file is stripped down and simplified compared to the logic code in gameInfo.lua. The code in the menu is there just so the towers can fire and the enemies move to make the menu more interesting.

They are very similar yes, but they do slightly different things and at the time i thought it would be easier to understand if i had them in separate files.

I hope that clears it up a bit :slight_smile:

Thanks,
Jamie [import]uid: 69826 topic_id: 29833 reply_id: 139729[/import]

No sorry i didn’t get it, Do you mean we are using both code in the game ?
Or just one of them .
I know 1 of them is simplified but which one we using ? [import]uid: 106206 topic_id: 29833 reply_id: 139749[/import]

We are using both, but in different files, e.g. The code in the menu.lua file is just for that file, it isn’t used anywhere else. The code in the gameInfo.lua file is just for that file and also isn’t used anywhere else.

You can remove the towers/enemy functions from the menu.lua file and the game will still run fine as the code that handles all the levels is located in the gameInfo file and isn’t related to the menu in any way.

I’m sorry if i’m explaining this badly! [import]uid: 69826 topic_id: 29833 reply_id: 139753[/import]

No need to be sorry but that was a funny explanation
i read it 100 times and still didn’t make any sense :stuck_out_tongue:

The code in the menu.lua file is just for that file, it isn’t used anywhere else. The code in the gameInfo.lua file is just for that file and also isn’t used anywhere else.

Anyway dont bother ill try to follow your code more and check what you are doing . [import]uid: 106206 topic_id: 29833 reply_id: 139758[/import]

I think I can explain it better.

You need both files (menu.lua and gameInfo.lua).
The logic code in MENU is decorative purposes, to make the menu more interesting (so tower in the menu can fire, or enemy in menu can move).

The logic code in the GAMEINFO is for the game itself, that’s why the logic code in GAMEINFO is more complex. [import]uid: 31508 topic_id: 29833 reply_id: 139766[/import]

Got it ! Thank you so much for your patient .
Add to your explanation it was me who did not notice that in menu there is towers that shoots and enemies that comes by .
My bad :slight_smile:
Now i got your code , and i am reading it line by line … i will let you know if i was lost somewhere !

Thank you again

Review : AND FOR all who are hesitating from buying the template i tell you : It worth the money , easy , well commented . the math is well done and i totally love it so far [import]uid: 106206 topic_id: 29833 reply_id: 139776[/import]

I just purchased the defense tower , i wonder why did you repeat the logic game code twice
in menu.lua and in gameinfo.lua ?
Can i know if i am missing something

[import]uid: 106206 topic_id: 29833 reply_id: 139728[/import]

Hi Maroun,

The logic code in the menu.lua file is stripped down and simplified compared to the logic code in gameInfo.lua. The code in the menu is there just so the towers can fire and the enemies move to make the menu more interesting.

They are very similar yes, but they do slightly different things and at the time i thought it would be easier to understand if i had them in separate files.

I hope that clears it up a bit :slight_smile:

Thanks,
Jamie [import]uid: 69826 topic_id: 29833 reply_id: 139729[/import]

No sorry i didn’t get it, Do you mean we are using both code in the game ?
Or just one of them .
I know 1 of them is simplified but which one we using ? [import]uid: 106206 topic_id: 29833 reply_id: 139749[/import]

We are using both, but in different files, e.g. The code in the menu.lua file is just for that file, it isn’t used anywhere else. The code in the gameInfo.lua file is just for that file and also isn’t used anywhere else.

You can remove the towers/enemy functions from the menu.lua file and the game will still run fine as the code that handles all the levels is located in the gameInfo file and isn’t related to the menu in any way.

I’m sorry if i’m explaining this badly! [import]uid: 69826 topic_id: 29833 reply_id: 139753[/import]

No need to be sorry but that was a funny explanation
i read it 100 times and still didn’t make any sense :stuck_out_tongue:

The code in the menu.lua file is just for that file, it isn’t used anywhere else. The code in the gameInfo.lua file is just for that file and also isn’t used anywhere else.

Anyway dont bother ill try to follow your code more and check what you are doing . [import]uid: 106206 topic_id: 29833 reply_id: 139758[/import]

I think I can explain it better.

You need both files (menu.lua and gameInfo.lua).
The logic code in MENU is decorative purposes, to make the menu more interesting (so tower in the menu can fire, or enemy in menu can move).

The logic code in the GAMEINFO is for the game itself, that’s why the logic code in GAMEINFO is more complex. [import]uid: 31508 topic_id: 29833 reply_id: 139766[/import]

Got it ! Thank you so much for your patient .
Add to your explanation it was me who did not notice that in menu there is towers that shoots and enemies that comes by .
My bad :slight_smile:
Now i got your code , and i am reading it line by line … i will let you know if i was lost somewhere !

Thank you again

Review : AND FOR all who are hesitating from buying the template i tell you : It worth the money , easy , well commented . the math is well done and i totally love it so far [import]uid: 106206 topic_id: 29833 reply_id: 139776[/import]