New Toys for your Sandbox Collection
by Mike Lilligreen · in Torque 2D Beginner · 02/18/2013 (4:15 am) · 32 replies
I've just released a new toy for the Sandbox: WorldWrapToy. You can grab a copy of it here: github.com/t2Dtutorials/Modules
It demonstrates keyboard bindings with a floaty, spaceship style movement behavior. It also uses Box2D sensors to mimic a feature older versions of the engine had - world limit wraps. Any feedback or suggestions for improvement are always welcome.
As a general discussion topic for the community, it would be nice to have a central location where everyone can easily find and share toys, example games, other scripts, or even art assets with the appropriate CC license. What is the best way to handle this? Simply a forum thread like this with links to our content? A page on the T2D wiki with links? A Torque 2D supplement repository on Github for things that are outside the scope of inclusion in the master/development branches of the engine?
Edit: updated title for sticky. Thanks Mich!
It demonstrates keyboard bindings with a floaty, spaceship style movement behavior. It also uses Box2D sensors to mimic a feature older versions of the engine had - world limit wraps. Any feedback or suggestions for improvement are always welcome.
As a general discussion topic for the community, it would be nice to have a central location where everyone can easily find and share toys, example games, other scripts, or even art assets with the appropriate CC license. What is the best way to handle this? Simply a forum thread like this with links to our content? A page on the T2D wiki with links? A Torque 2D supplement repository on Github for things that are outside the scope of inclusion in the master/development branches of the engine?
Edit: updated title for sticky. Thanks Mich!
About the author
#2
02/18/2013 (4:57 am)
New toy is in the development branch of our GitHub repository. It's located in https://github.com/GarageGames/Torque2D/tree/development/modules/ShapeVectorToy. The toy's purpose is to show off how to create and customize ShapeVector objects, which are stock in Torque 2D. It's not flashy or interactive (outside of the custom tools), but it shows how to create square, triangle, circle, and custom objects using a poly list.
#3
On the other hand, I don't remember how flexible the toy loader is. Could we keep toys a level deeper? (I.e. modules/something/cooltoy) and still have the sandbox find them? Does this apply to modules in general?
02/18/2013 (4:45 pm)
I'd be interested to see people building toys in a standard GitHubbable way - i.e., a repository is the main toy folder, so that from the modules/ directory we can write git clone https://github.com/somebody/cooltoy.git, and have a modules/cooltoy directory ready to go. I would suggest submodules, but apparently they're heinous, so taking advantage of nested git repos seems like the way to go.On the other hand, I don't remember how flexible the toy loader is. Could we keep toys a level deeper? (I.e. modules/something/cooltoy) and still have the sandbox find them? Does this apply to modules in general?
#4
If you look at the root "main.cs" you'll see
You can scan as many times as you like, whenever you like as it's not a one-off thing.
As a quick test, create a sub-folder off your root like "CoolModules" and simply move half of the modules in the "modules" sub-folder into it. Then use the follow to scan both sub-folders:
You can nest them within other folders as you suggest but I have found that having a folder name that contains modules immediately within it is a far better way to organize things.
As a side-note and slightly off-topic, this multiple-scanning of modules is an important part of how game projects work and how it worked in 3SS. Basically you had your modules available to the "editor" then when a game project was produced, the game project had a root module for the game which the user modified and it had a dependency on any other modules is required. The editor can then synchronize and publish any modules required in the dependency chain and we can even publish on the assets being used etc. This meant that the editor knew which modules were required for the game and could even update them after the game project had been created, something TGB could never do.
02/19/2013 (3:02 am)
The module system doesn't care at all where they are located. You can have several folders, each containing their own modules.If you look at the root "main.cs" you'll see
// Scan modules. ModuleDatabase.scanModules( "modules" );
You can scan as many times as you like, whenever you like as it's not a one-off thing.
As a quick test, create a sub-folder off your root like "CoolModules" and simply move half of the modules in the "modules" sub-folder into it. Then use the follow to scan both sub-folders:
// Scan modules. ModuleDatabase.scanModules( "modules" ); ModuleDatabase.scanModules( "coolmodules" );
You can nest them within other folders as you suggest but I have found that having a folder name that contains modules immediately within it is a far better way to organize things.
As a side-note and slightly off-topic, this multiple-scanning of modules is an important part of how game projects work and how it worked in 3SS. Basically you had your modules available to the "editor" then when a game project was produced, the game project had a root module for the game which the user modified and it had a dependency on any other modules is required. The editor can then synchronize and publish any modules required in the dependency chain and we can even publish on the assets being used etc. This meant that the editor knew which modules were required for the game and could even update them after the game project had been created, something TGB could never do.
#5
www.dropbox.com/s/iu3dnnktagyfl2o/NinjaDemoToy.zip
Updated version of the old TGB Platformer demo located here
docs.garagegames.com/tgb/official/content/documentation/Game%20Tutorials/Ninja%2...
Demonstrates Platformer style character movement on Platforms and obstacles.
There are some issues that I am still trying to sort out but it works.
For instance, when a character collides with a platform or anything while in the air the charcter hangs on the object if you continue to press left or right or jump.
02/20/2013 (5:18 pm)
Ninja Platformer Demowww.dropbox.com/s/iu3dnnktagyfl2o/NinjaDemoToy.zip
Updated version of the old TGB Platformer demo located here
docs.garagegames.com/tgb/official/content/documentation/Game%20Tutorials/Ninja%2...
Demonstrates Platformer style character movement on Platforms and obstacles.
There are some issues that I am still trying to sort out but it works.
For instance, when a character collides with a platform or anything while in the air the charcter hangs on the object if you continue to press left or right or jump.
#7
02/22/2013 (4:22 pm)
nice.
#8
I used Mike Liligreens worldwrap toy as a template for setting up my own platformController behavior. Anyway I am working on making 2way platforms function next as well as Some basic ai ect.
I have also added some sandbox tools to the code to change the default keyboard layout as well as run speed and jump speed ect.
but here is the much cleaner platform demo toy
www.dropbox.com/s/zgptg8od2ku5eyt/PlatformDemoToy.zip
You can delete the old ninjademotoy
02/24/2013 (4:24 pm)
I have completely redone the platformer Demo and made a new toy. It is alot cleaner and I have solved the Mid Air hangups when colliding with platforms ect.I used Mike Liligreens worldwrap toy as a template for setting up my own platformController behavior. Anyway I am working on making 2way platforms function next as well as Some basic ai ect.
I have also added some sandbox tools to the code to change the default keyboard layout as well as run speed and jump speed ect.
but here is the much cleaner platform demo toy
www.dropbox.com/s/zgptg8od2ku5eyt/PlatformDemoToy.zip
You can delete the old ninjademotoy
#9
02/27/2013 (5:27 am)
Just a little feedback for the PlatformDemoToy: I noticed if you walk off the edge of an object and start to fall, but immediately try to walk back towards the object it launches you into the air as if you jumped. Not sure if that's intentional or not, but I'd generally expect to fall off an object as a player, Mario style ;)
#10
02/27/2013 (5:31 am)
It has to do with the collision box and the way it is angled. it is something I am still tweaking. I am abput to completely redodoe the collision box. thanks for the feedback thopugh. I put this together to simply learn how to work with the new TD2 MIT.
#11
02/28/2013 (1:12 pm)
In case anyone is wondering, and hopefully to save someone time, I am 90% finished with the conversion of the old TGB BehaviorShooter project. I should be wrapping it up this week and submitting it as a pull request.
#12
02/28/2013 (1:34 pm)
Excellent news Michael.. I can not wait.
#13
03/03/2013 (5:59 am)
My LayerSpinnerToy is now finished, unless someone finds a glaring error with it. I have it on dropbox for now, but if we are allowed to upload to the wiki or something like me know: https://dl.dropbox.com/u/18965446/CWLayerSpinnerToy.zip
#14
03/03/2013 (10:57 pm)
Could someone do a split-screen camera toy, please?
#15
Both toys (plus the WorldWrapToy) can be found here: github.com/t2Dtutorials/Modules
03/24/2013 (2:06 am)
There's a couple new toys in my modules repo that I haven't mentioned here yet: AudioBasicsToy and FadeInOutToy.Quote: AudioBasicsToy
A Sandbox toy that covers the basics of audio playing in T2D. Includes a background music player and a short sound effects demo. All sounds are from the ToyAssets module.
FadeInOutToy
This Sandbox toy shows how to use the color blending features of scene objects to create a fade in / fade out effect or to transition from one color to another.
Both toys (plus the WorldWrapToy) can be found here: github.com/t2Dtutorials/Modules
#17
04/21/2013 (7:37 am)
Hey Mike - Minor fix to accommodate recent updates, need to change TrapClass::handleCollision() to TrapClass::onCollision().
#18
04/21/2013 (8:24 am)
Hi Richard, I did update the toys after those collision changes were made. I just checked the repo and it is showing TrapClass::onCollision().
#19
Keys:
WASD: move camera
IJKL: move object being modified
Esc: save to taml
Enter: load from taml
Flow: Select an image asset from the top left list and click "load sprite". Click on the object, this will pickpoint() a list of objects and choose one from the top right list. Click "modify object" to display its fields, you can edit them. When done editing click "save modifiers". When done with the scene press escape and the taml will be saved within *moduledirectories*/TheGarage/1/savedscenes/". I'll be adding more things that I need for my game in the future. Tip: enable aabb to see scene objects.
https://www.dropbox.com/s/v0oxcayo1nceagi/TheGarage.rar
6/5/13 edit: minor bug fixes.
5/24/13 edit: added button to create box collision shape. bug fixes.
5/7/13 edit: added scene modification list.
5/6/13 edit: sprite animation bug fix. added scene object creation.
05/05/2013 (6:36 am)
I've started "toying" (hehe) with a minimalistic scene editor. It's still early but somewhat useful.Keys:
WASD: move camera
IJKL: move object being modified
Esc: save to taml
Enter: load from taml
Flow: Select an image asset from the top left list and click "load sprite". Click on the object, this will pickpoint() a list of objects and choose one from the top right list. Click "modify object" to display its fields, you can edit them. When done editing click "save modifiers". When done with the scene press escape and the taml will be saved within *moduledirectories*/TheGarage/1/savedscenes/". I'll be adding more things that I need for my game in the future. Tip: enable aabb to see scene objects.
https://www.dropbox.com/s/v0oxcayo1nceagi/TheGarage.rar
6/5/13 edit: minor bug fixes.
5/24/13 edit: added button to create box collision shape. bug fixes.
5/7/13 edit: added scene modification list.
5/6/13 edit: sprite animation bug fix. added scene object creation.
#20
05/20/2013 (6:03 am)
I just wanted to thank you for that toy Practicing, this ended up being the best clue for me to figure out how to make my own menus :)
Employee Michael Perry
ZombieShortbus
Until either of those happen, we can use this thread for the time being. I'll sticky it.