Some questions I need answered
by Johan Brodd · in Torque Game Builder · 10/28/2009 (3:34 am) · 3 replies
I'm still trying to get the basics down in TGB, and these question may seam noobish, but please bare with me for the time being. I'm not a big script fan, so this is all about behaviors. :)
1. So I want to set up a canon to shoot a bullet. The bullet is to be self destroyed after a while. This I've got right so far. But when I try to perform this then I'm able to shoot bullets for a short period of time. So how do I set up this to work properly?
2. I've got two different colored blocks. When the same color colides with eachother then they should repell each other, but if two different colors are hit then both should be destroyed. How do I set up this to work right?
I've done this quite easily in GameMaker 7, but how do I do these things in TGB? Thanks in advance.
1. So I want to set up a canon to shoot a bullet. The bullet is to be self destroyed after a while. This I've got right so far. But when I try to perform this then I'm able to shoot bullets for a short period of time. So how do I set up this to work properly?
2. I've got two different colored blocks. When the same color colides with eachother then they should repell each other, but if two different colors are hit then both should be destroyed. How do I set up this to work right?
I've done this quite easily in GameMaker 7, but how do I do these things in TGB? Thanks in advance.
About the author
#2
In the edit tab for each object, there is a list of layers 0-31 which you can use to select which layers to collide with. Play around a bit with it to get a feel for how it works. You can set it so that bullets can hit objects, but the object can't swat bullets out of the way.
10/28/2009 (4:10 am)
If I understand #1 right, both of these questions can be answered with "collision layers" :)In the edit tab for each object, there is a list of layers 0-31 which you can use to select which layers to collide with. Play around a bit with it to get a feel for how it works. You can set it so that bullets can hit objects, but the object can't swat bullets out of the way.
#3
Thank you very much! You made my day with your post :)))
It solved my problem that I had with the Mini Platformer Tutorial:
www.garagegames.com/community/forums/viewthread/104699
10/28/2009 (6:00 am)
@RonnyThank you very much! You made my day with your post :)))
It solved my problem that I had with the Mini Platformer Tutorial:
www.garagegames.com/community/forums/viewthread/104699
Associate William Lee Sims
Machine Code Games
As for part (2), that's quite easy.
It depends upon how you make the different colored blocks. If you are using different imagemaps and frames, you can check those values in the collision callback. It's just a simple compare at that point!