MyFishGame (Nemo Version) and questions about it
by Rogers Vizcaino · in Torque Game Builder · 07/31/2006 (7:20 am) · 7 replies
Hi friends,
I am from Colombia, South America. I got my license of TGB 5 days ago and after that i was wondering about what things can i do with the software. I think it's amazing.
Ok, after following the FishGame Tutorial i tried to make my own version (Nemo Version), i've acomplished some goals, but i have so many problems with it. I will try to list them here and if someone can help me i will be very grateful. I will publish some screenshots right now.
1. My big first problem is that i don't know how change the static fish by an animated fish, what i am doing is dragging the fish animation to the level builder and then setup the animation in the same way as the static. But it doesn't work, doesn't move or react.
2. I don't know how to show bitmaps, like Dead or Ready? or things like that, what i am actually doing is dragging the bitmap to level builder, changing the setEnabled to false on level load, and enabling it when the fish die, what i do after that is setting back setEnable to false in the fish respawn function, but it doesn't work, it doesn't dissapear.
ok, thats for now, please excuse my bad use of english.
Thank you very much.
I am from Colombia, South America. I got my license of TGB 5 days ago and after that i was wondering about what things can i do with the software. I think it's amazing.
Ok, after following the FishGame Tutorial i tried to make my own version (Nemo Version), i've acomplished some goals, but i have so many problems with it. I will try to list them here and if someone can help me i will be very grateful. I will publish some screenshots right now.
1. My big first problem is that i don't know how change the static fish by an animated fish, what i am doing is dragging the fish animation to the level builder and then setup the animation in the same way as the static. But it doesn't work, doesn't move or react.
2. I don't know how to show bitmaps, like Dead or Ready? or things like that, what i am actually doing is dragging the bitmap to level builder, changing the setEnabled to false on level load, and enabling it when the fish die, what i do after that is setting back setEnable to false in the fish respawn function, but it doesn't work, it doesn't dissapear.
ok, thats for now, please excuse my bad use of english.
Thank you very much.
About the author
#2
1) It's difficult to see why it's not working without code. When your in the level builder, is your fish animated? Don't forget to build your animation if you haven't already done so. You can do by clicking on the Create tab. Then where there are three icons (just above the datablock drop-down menu), the white one with a blue curve is the animation builder. Click that and create your animation. (If you don't know how to use it, check the "animated sprites.pdf" file in your torque documentation folder). It'll show you how to create the animation and add it to your game.
2) To change the image, you could use the "setImageMap" command. Say you have an imagemap called "deadImageMap" and another one called "readyImageMap". You could do something like this:
Depending on your code, you might be better off using Switch/Case commands, but that's the basic idea. Simply use the setImageMap command depening on it's status.
Hope that helps.
EDIT: just read Kevin's post and realised that Dead and Ready are screens, not player status. In that case, do what Kevin suggests. I'll leave my answer to the second part anyway, incase you want to know how to switch imagemaps :)
07/31/2006 (6:40 pm)
Ok, this is quite a big question ;)1) It's difficult to see why it's not working without code. When your in the level builder, is your fish animated? Don't forget to build your animation if you haven't already done so. You can do by clicking on the Create tab. Then where there are three icons (just above the datablock drop-down menu), the white one with a blue curve is the animation builder. Click that and create your animation. (If you don't know how to use it, check the "animated sprites.pdf" file in your torque documentation folder). It'll show you how to create the animation and add it to your game.
2) To change the image, you could use the "setImageMap" command. Say you have an imagemap called "deadImageMap" and another one called "readyImageMap". You could do something like this:
if player is dead ( << replace with your collision code, or whatever your using to determine whether it's dead)
$myObject.setImageMap("deadImageMap");
if player is ready
$myObject.setImageMap("readyImageMap");Depending on your code, you might be better off using Switch/Case commands, but that's the basic idea. Simply use the setImageMap command depening on it's status.
Hope that helps.
EDIT: just read Kevin's post and realised that Dead and Ready are screens, not player status. In that case, do what Kevin suggests. I'll leave my answer to the second part anyway, incase you want to know how to switch imagemaps :)
#3
07/31/2006 (7:00 pm)
Looking at his screenshots, I kinda guessed Muerto! means "You dead foo!" or "You ready, foo!?" :P
#4
08/01/2006 (6:03 am)
Ah yes lol. I only looked at the first screenshot, and assumed the rest were similar :/
#5
08/01/2006 (7:51 am)
Yes friends, Muerto! means You are a Dead Fish (in spanish), it's a bitmap that i wish to show when the dead variable is set to 1 and i want to hide it when the dead var is set to 0.
#6
Or, when the person dies, and the screen comes up the first time, try reloading the level:
I think that would reset all variables, and it should work. Give it a try and see if it works.
08/01/2006 (7:58 am)
Check the GUI link that Kevin posted. For this type of thing, you could use a GUI. It also means you can have buttons like "retry" or "exit to main menu". In particular, you would want to use pop/push dialogs, which are explained in those tutorials. Or, when the person dies, and the screen comes up the first time, try reloading the level:
function onDeath(){
$deathScreen.setEnabled(true);
schedule(5000, 0, "reloadLevel"); //This will wait 5 seconds.The 5000 is in milliseconds.
}
function reloadLevel(){
sceneWindow2d.loadLevel("<project name>/data/levels/myLevel.t2d");
}I think that would reset all variables, and it should work. Give it a try and see if it works.
Torque Owner Kevin James
As far as the bitmaps go, I would use a GuiBitmapCtrl. If you have no idea what I am talking about then, you'd be better off using the .setVisible(bool) instead of .setEnabled.
If you want to learn more about the GUI look here