My TD game~ HOHO~ thank torque!
by KevinYuen · in Torque 2D Beginner · 03/15/2013 (10:49 pm) · 21 replies


#2
03/15/2013 (11:18 pm)
Way to go! Keep building!
#3
I'm curious : How long did it take you to create this nifty Tower Defense toy?
03/16/2013 (3:53 am)
Awesome work, Kevin!I'm curious : How long did it take you to create this nifty Tower Defense toy?
#4
just a simple game :).
There is still a lot of work to be done.
thank torquers :)
03/16/2013 (4:15 am)
Almost five days ago, i started working on this. just a simple game :).
There is still a lot of work to be done.
thank torquers :)
#5
03/16/2013 (4:18 am)
Awesome work! Keep those screenshots coming.
#6
03/16/2013 (5:55 pm)
That looks fun! If you want someone to help test it, let me know. I only have access to Windows though, if it matters.
#8

I have a suggestion:
About attachGUI method, it can support position offset. :)
03/16/2013 (10:20 pm)

I have a suggestion:
About attachGUI method, it can support position offset. :)
#10

three questions:
1. internationalization support.
as michael perry said: "Torque 2D is a great engine and GarageGames wants it to reach as many people as possible."
So this is something that needs to be solved, and the quicker the better.
2. gui attach to sceneobjects, is very usefull. If can support offset is even better.
3. more examples, such as network, music, load scene.. etc.
I will stick to doing it, torque2d 2.0 is very powerfull. :)
03/18/2013 (9:13 pm)
Recent screenshot. :)
three questions:
1. internationalization support.
as michael perry said: "Torque 2D is a great engine and GarageGames wants it to reach as many people as possible."
So this is something that needs to be solved, and the quicker the better.
2. gui attach to sceneobjects, is very usefull. If can support offset is even better.
3. more examples, such as network, music, load scene.. etc.
I will stick to doing it, torque2d 2.0 is very powerfull. :)
#11
03/18/2013 (9:55 pm)
For gui objects in a scene you can use sprites and other scene objects as gui elements. These can be placed however you like.
#12
I don't know if you saw the sticky at the top of the forum, but I have been working on a few additional toys that show off different features. Based on your request, the AudioBasicsToy could help you with music and sound effect examples. I also use sprite based buttons in that toy, which touches on what Richard mentioned. I really prefer sprite/scene object based GUI elements - you can do a lot of cool things with them in TorqueScript. Having offsets, as you would like, is not a problem.
Just grab a zip copy of the toys from my link and copy them into your modules folder:
github.com/t2Dtutorials/Modules
03/19/2013 (5:15 am)
First off, thanks for posting the screenshots - looks really good so far.I don't know if you saw the sticky at the top of the forum, but I have been working on a few additional toys that show off different features. Based on your request, the AudioBasicsToy could help you with music and sound effect examples. I also use sprite based buttons in that toy, which touches on what Richard mentioned. I really prefer sprite/scene object based GUI elements - you can do a lot of cool things with them in TorqueScript. Having offsets, as you would like, is not a problem.
Just grab a zip copy of the toys from my link and copy them into your modules folder:
github.com/t2Dtutorials/Modules
#13
@Kevin : If you are unfamiliar with the Gui system, I suggest following Mike's advice and going with a Sprite-based UI for now. The Gui system as it stands now can be infuriating to work with and is due for a major overhaul.
03/19/2013 (5:52 am)
Cool modules, Mike!@Kevin : If you are unfamiliar with the Gui system, I suggest following Mike's advice and going with a Sprite-based UI for now. The Gui system as it stands now can be infuriating to work with and is due for a major overhaul.
#14
03/19/2013 (7:06 am)
thank you mike and simon. good modules :)
#15
I want create a progressbar for dynamic object, such as HP and MP, they are need update position per-frame.
If using sprite-based UI, i need update per-frame in script and re-design progress control? :(
@Mike:
sprite base buttons are very cool, but i need some complex controls.. uh..
03/19/2013 (7:54 am)
@Simon:I want create a progressbar for dynamic object, such as HP and MP, they are need update position per-frame.
If using sprite-based UI, i need update per-frame in script and re-design progress control? :(
@Mike:
sprite base buttons are very cool, but i need some complex controls.. uh..
#16
Remember that my words are only suggestions, there is nothing wrong with using the Gui system. All I am saying is that it will eventually be replaced. Eventually = nobody knows when.
03/19/2013 (8:02 am)
Yes, indeed, if you make your UI based on Sprites, you would have to customize the HP and MP bars to be updated in real-time and you would need to write the script for the progress, etc.Remember that my words are only suggestions, there is nothing wrong with using the Gui system. All I am saying is that it will eventually be replaced. Eventually = nobody knows when.
#17
thank Simon for your reply, your suggestions are very usefull for me.
03/19/2013 (8:07 am)
:) I am looking forward to the new gui system.thank Simon for your reply, your suggestions are very usefull for me.
#18
03/19/2013 (8:43 am)
Kevin, instead of updating your progress bar positions each frame, just use a joint between the progress sprite and your object sprite. The progress should mount to the object and move with it properly.
#19
For example, losing HP is usually due to an event happening, like being hit with a projectile. You can set up an event based system where you let the progress bar know a HP subtraction event has occurred and to recalculate the width of the bar (the bar could be a sprite or shape vector) based on the new ratio of current HP to total HP. This saves you from having to recalculate the bar every frame.
Obviously a drawback to a sprite based GUI system is that you have to script a lot of the functionality for complex objects yourself, besides buttons there are not many examples available at the moment.
03/19/2013 (9:06 am)
@Kevin - you can use joints to attach a sprite GUI to a moving object in your scene. If your comment about updating positions per frame is in regards to how full or empty the progress bar should be - then there are many ways to go about implementing this.For example, losing HP is usually due to an event happening, like being hit with a projectile. You can set up an event based system where you let the progress bar know a HP subtraction event has occurred and to recalculate the width of the bar (the bar could be a sprite or shape vector) based on the new ratio of current HP to total HP. This saves you from having to recalculate the bar every frame.
Obviously a drawback to a sprite based GUI system is that you have to script a lot of the functionality for complex objects yourself, besides buttons there are not many examples available at the moment.
#20
I can post more on how to handle in-scene health/mana bars later.
03/19/2013 (3:25 pm)
No no no - Like Mike says, don't update the health bars every frame! Only update them when they change. Just add a joint to attach them to the unit and let them control themselves.I can post more on how to handle in-scene health/mana bars later.

KevinYuen
release version fps: 500-700