Ive spent 3 hours on a problem, I need some help
So I am making a fishing game. Everything is going great however, I have this one minor problem.
Basically I have it so that when the fish enter the lure zone the can be caught on the lure. I have 3 private variables when the fish is lured and caught.
The problem I am having is that I only want one fish to be caught. When the fish is caught all the fish in the lure zone all of the fish go into the lure. I have it set up so that there can only be 1 fish on the lure. However, the other fish in the area just sit there dead.
My partial solution is to see if self.motion,linear.x = 0 then move the fish left. But that didn't work.
Anyway I have spent a great deal of time on this. Does anybody have any advice![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
Thanks in advance
Basically I have it so that when the fish enter the lure zone the can be caught on the lure. I have 3 private variables when the fish is lured and caught.
The problem I am having is that I only want one fish to be caught. When the fish is caught all the fish in the lure zone all of the fish go into the lure. I have it set up so that there can only be 1 fish on the lure. However, the other fish in the area just sit there dead.
My partial solution is to see if self.motion,linear.x = 0 then move the fish left. But that didn't work.
Anyway I have spent a great deal of time on this. Does anybody have any advice
![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
Thanks in advance
Comments
I have 2 atributes that are private for the fish
IsLured
IsCaught
and a global attribute LureOccupied.
The problem is that once a random number reaches 3
IsLured and IsCaught become true and they all race for the lure at once.
But when lure occupied is true the other fish just stop and do nothing..
Is this game salads way of saying "you made a coding error". I feel that in other programs the game would crash .
I guess what I need is to have Is Lured and IS caught variables for each individual fish.
I want a lot of fish on the screen so I guess what I have to do is have a lot of dummy fish, that don't do anything and spawn a really catching fish one at a time. I know this will work, thanks slick.
On another note I find my games to have ALOT of variables. It seems like with game salad you have to make way more variables than if you were to make a game with code. Does anybody else find this?
Deep Blue's Project Attributes program makes managing the attributes a lot less frustrating when you group them up in the list, so much easier to keep track of.
the issue is that a game variable of 3 is triggering all the self attributes to trigger. Would you consider doing a self attribute Proximity and then assign its magnitude to the hook. Based on a certain distance that could set the self attributes isLured and isCaught on that one closest fish and notify the Game attribute LureOccupied so all the other fish could keep moving even it they get into range?
Not sure if it is a good solution based on your game play but it worked in my project.
http://www.deepblueapps.com/Deep_Blue_Ideas_Ltd./GS_Attributes.html