LD36 competition entry (kinda)
by Simon Love · 09/01/2016 (4:14 am) · 3 comments
For those interested, here's a short playthrough of my project.
[youtube=bdFBMJVn6GY]
Time taken : ~40 hours
Torque 2D branch used : Custom, not that far from current official dev branch.
Github repo : You can grab the entire source here
Complete Package : You can grab the source + .exe here
This GuiControl fades in for fadeintime ms, waits for waitTime ms and fades out over fadeoutTime ms.
Very useful for intro screens and the like, could even be used for ads.
This guiControl is built to respond to touch/mouse clicks and keyboard input.
To receive keyboard input however, you must make sure that
The bitmap Field does not work with the asset system (it is the same with certain variations of GuiButton).
The proper way to point to a .png file in module TestModule would be
Use behavior Inputs. I had built my ControlObject system in a very twisted manner; It worked until it didn't.
Behavior connections are the preferred way to communicate between behaviors of a common object. Try to avoid Behaviors referencing other behaviors through variables as this introduces many weird namespace issues and bugs that are impossibly hard to track down.
For those with spare time and mental fortitude, the Issue is described here in an extremely confusing manner.
The TextSprite is awesome and saves so much trouble. Used in conjunction with my SceneWindow-based UI system, it instantly adds a very smooth feel to any project. In the video/project, you can see it used for all fading text.
Tiled can export CSV files and reading comma-separated values is easily done in Torque2D.
Open a FileObject and read each line using FileObject.readLine(); then parse the resulting string using GetUnit instead of GetWord. GetUnit will let you specify the separator character (in this case, commas) and might be useful if you are in a hurry to read map files!
That's all for now. Every project brings out issues in Torque2D but also greatly augments my admiration of the engine. Other engines might provide easier paths but T2D is still the best way to further my coding skills.
Now if someone would just fix that OpenGL 1.2 backend and add shader support...
[youtube=bdFBMJVn6GY]
Time taken : ~40 hours
Torque 2D branch used : Custom, not that far from current official dev branch.
Github repo : You can grab the entire source here
Complete Package : You can grab the source + .exe here
GuiFadeinBitmapCtrl
This GuiControl fades in for fadeintime ms, waits for waitTime ms and fades out over fadeoutTime ms.
Very useful for intro screens and the like, could even be used for ads.
This guiControl is built to respond to touch/mouse clicks and keyboard input.
To receive keyboard input however, you must make sure that
- your GuiFadeinBitmapCtrl has a profile where canKeyFocus = true
- After your GuiFadeinBitmapCtrl has been pushed to the Canvas, call its setFirstResponder method. Even though the Torsion popup will claim that this is deprecated, that is not the case.
The bitmap Field does not work with the asset system (it is the same with certain variations of GuiButton).
The proper way to point to a .png file in module TestModule would be
... bitmap = "^TestModule/images/MyBitmap.png"; ...
Behavior Inputs
Use behavior Inputs. I had built my ControlObject system in a very twisted manner; It worked until it didn't.
Behavior connections are the preferred way to communicate between behaviors of a common object. Try to avoid Behaviors referencing other behaviors through variables as this introduces many weird namespace issues and bugs that are impossibly hard to track down.
For those with spare time and mental fortitude, the Issue is described here in an extremely confusing manner.
TextSprite
The TextSprite is awesome and saves so much trouble. Used in conjunction with my SceneWindow-based UI system, it instantly adds a very smooth feel to any project. In the video/project, you can see it used for all fading text.
CSV
A Tiled importer was once proposed for Torque2D but never got finalized. Coding your own importer or a T2D tilemap creator might be a fun project but in the meantime, you can use CSV files!Tiled can export CSV files and reading comma-separated values is easily done in Torque2D.
Open a FileObject and read each line using FileObject.readLine(); then parse the resulting string using GetUnit instead of GetWord. GetUnit will let you specify the separator character (in this case, commas) and might be useful if you are in a hurry to read map files!
Conclusion
That's all for now. Every project brings out issues in Torque2D but also greatly augments my admiration of the engine. Other engines might provide easier paths but T2D is still the best way to further my coding skills.
Now if someone would just fix that OpenGL 1.2 backend and add shader support...
About the author
I am here to help. I've worked at every imaginable position in game development, having entered the field originally as an audio guy.
#2
Here's a direct link to the youtube demonstration video. Since nobody maintains this site anymore it won't get fixed to use html5 instead of flash embedded videos. :/
09/01/2016 (7:21 am)
Neat project. :)Here's a direct link to the youtube demonstration video. Since nobody maintains this site anymore it won't get fixed to use html5 instead of flash embedded videos. :/
#3
09/01/2016 (2:55 pm)
Thanks Nathan! I thought the embed would fix itself after Preview. 
Associate Peter Robinson