Right, what I currently have is a game where one charcter follows your mouse and another character trys to "catch" your character, what I want to do is have three buttons, one easy diffuclty which spawns 1 enemy character, medium difficulty spawns a second enemy character and finally a hard difficulty were it spawns a third enemy character. Any ideas on how to do this?
Offline
Try this
first Button easy
when gf clicked broadcast [easy v]Second Button medium
when gf clicked broadcast [easy v] broadcast [medium v]third Button hard
when gf clicked Broadcast [easy v] broadcast [medium v] Broadcast [hard v]First enemy
When I receive [easy v] ScriptsSecond enemy
When I receive [medium v] ScriptsThird enemy
When I receive [hard v] ScriptsThere is a project, where I use this: Link
Last edited by Tohmis (2013-04-19 07:41:02)
Offline
Create the three buttons.
Create a variable called Difficulty.
Depending on what button is pressed change the difficulty variable to Easy, Medium or Hard.
Button press also launches a broadcast to start the game.
In sprites for your 3 monsters in the game start when I receive script put:
if <(Difficulty) = [Easy]> Your script here endReplacing easy in the 2nd and third as appropriate.
Last edited by Smozzick (2013-04-19 07:43:59)
Offline
[scratchblocks]
when gf clicked
broadcast [difficulty menu]
[scratchblocks]
When [easy] clicked
broadcast [easydifficulty]
[scratchblocks]
When [hard] clicked
broadcast [harddifficulty]
[scratchblocks]
When [medium] clicked
broadcast [mediumdifficulty]
Sprite 1:
[scratchblocks]
when i receive [easy]
show
[scratchblocks]
when i receive [medium]
show
[scratchblocks]
when i receive [hard]
show
Sprite 2: [scratchblocks]
when i receive [medium]
show
[scratchblocks]
when i receive [hard]
show
Sprite 3:
[scratchblocks]
when i receive [hard]
show
Offline
Suparing01 wrote:
when gf clicked broadcast [difficulty menu v]When [easy v] clicked broadcast [easydifficulty v]When [hard v] clicked broadcast [harddifficulty v]When [medium v] clicked broadcast [mediumdifficulty v]Sprite 1:when i receive [easy v] showwhen i receive [medium v] showwhen i receive [hard v] showSprite 2:when i receive [medium v] showwhen i receive [hardv v] showSprite 3:when i receive [hard v] show
Fixed.
You just need "[-/scratchblocks-]" after every "[-scratchblocks-]", without the "-"'s.
Regards, CAA14
Last edited by CAA14 (2013-04-19 14:17:54)
Offline
CAA14 wrote:
Suparing01 wrote:
when gf clicked broadcast [difficulty menu v]When [easy v] clicked broadcast [easydifficulty v]When [hard v] clicked broadcast [harddifficulty v]When [medium v] clicked broadcast [mediumdifficulty v]Sprite 1:when i receive [easy v] showwhen i receive [medium v] showwhen i receive [hard v] showSprite 2:when i receive [medium v] showwhen i receive [hardv v] showSprite 3:when i receive [hard v] showFixed.
You just need "[-/scratchblocks-]" after every "[-scratchblocks-]", without the "-"'s.Regards, CAA14
Silly me, thanks! :p
Offline
Suparing01 wrote:
CAA14 wrote:
Suparing01 wrote:
when gf clicked broadcast [difficulty menu v]When [easy v] clicked broadcast [easydifficulty v]When [hard v] clicked broadcast [harddifficulty v]When [medium v] clicked broadcast [mediumdifficulty v]Sprite 1:when i receive [easy v] showwhen i receive [medium v] showwhen i receive [hard v] showSprite 2:when i receive [medium v] showwhen i receive [hardv v] showSprite 3:when i receive [hard v] showFixed.
You just need "[-/scratchblocks-]" after every "[-scratchblocks-]", without the "-"'s.Regards, CAA14Silly me, thanks! :p
No problem.
Regards,
CAA14
Offline
scorch2 wrote:
I can't find the "When * clicked" block, all I have is the "When sprite * clicked"
Yes, that's the one.
The block is:
when [sprite 1] clickedor, the green flag one is:
when gf clickedIf you are doing 2.0, then it's under events i believe, and in 1.4 i think it's under control.
Last edited by CAA14 (2013-04-22 10:40:53)
Offline
Actually, I have decided to put 3 sprites at the top and make it so when they are clicked the game begins, however, I have sprite 1 which is the character, sprite 2 which is the easy settings and sprite 3 which is the enemys, when I try to put "when sprite 2 clicked in the sprite 1 scripts, it only says "when sprite 1 clicked" so how can I change this?
Offline
Sorry for the triple post, I can't edit my previous posts. Forgot what I said in the previous posts, all I want to I want to know now is how to stop my three bad guys from overlapping each other and how to make the others enemys disappear if the easy setting is clicked?
Offline
scorch2 wrote:
Actually, I have decided to put 3 sprites at the top and make it so when they are clicked the game begins, however, I have sprite 1 which is the character, sprite 2 which is the easy settings and sprite 3 which is the enemys, when I try to put "when sprite 2 clicked in the sprite 1 scripts, it only says "when sprite 1 clicked" so how can I change this?
Ah... i see.
Well, you really can't, but there are work arounds. Basically, you can do any of these things:
- Make a variable that is set to no if sprite 2 is not clicked(at the start up) and yes once it is.
- use a broadcast that sprite 2 sends when it's clicked.
Regards,
CAA14
Offline
CAA14 wrote:
scorch2 wrote:
Actually, I have decided to put 3 sprites at the top and make it so when they are clicked the game begins, however, I have sprite 1 which is the character, sprite 2 which is the easy settings and sprite 3 which is the enemys, when I try to put "when sprite 2 clicked in the sprite 1 scripts, it only says "when sprite 1 clicked" so how can I change this?
Ah... i see.
Well, you really can't, but there are work arounds. Basically, you can do any of these things:
- Make a variable that is set to no if sprite 2 is not clicked(at the start up) and yes once it is.
- use a broadcast that sprite 2 sends when it's clicked.
Regards,
CAA14
Thats sorted, now how can I stop my three enemys from overlapping when chasing my character?
Offline
scorch2 wrote:
CAA14 wrote:
scorch2 wrote:
Actually, I have decided to put 3 sprites at the top and make it so when they are clicked the game begins, however, I have sprite 1 which is the character, sprite 2 which is the easy settings and sprite 3 which is the enemys, when I try to put "when sprite 2 clicked in the sprite 1 scripts, it only says "when sprite 1 clicked" so how can I change this?
Ah... i see.
Well, you really can't, but there are work arounds. Basically, you can do any of these things:
- Make a variable that is set to no if sprite 2 is not clicked(at the start up) and yes once it is.
- use a broadcast that sprite 2 sends when it's clicked.
Regards,
CAA14Thats sorted, now how can I stop my three enemys from overlapping when chasing my character?
Fortunately, that's real easy. The problem is that, as far as it sounds, you do not have any layer order, meaning that your enemies aren't in different places as far as back and forth, unless you click on one to bring it to the front. To control what layer a sprite is on, this is the most easy way I know of so far:
When gf clicked Broadcast [layer 1 v] Broadcast [layer 2 v] Broadcast [layer 3 v] Etc...It really doesn't matter where you put the above script, but I would suggest somewhere you will remember, like the stag or main character sprite.
When I receive [layer 1 v] go to frontNow remember, your basically stacking the layers, starting at [i]the bottom and stacking to the top[/]. This means that layer 1 is the bottom.
Last edited by CAA14 (2013-04-25 07:20:20)
Offline
CAA14 wrote:
scorch2 wrote:
CAA14 wrote:
Ah... i see.
Well, you really can't, but there are work arounds. Basically, you can do any of these things:
- Make a variable that is set to no if sprite 2 is not clicked(at the start up) and yes once it is.
- use a broadcast that sprite 2 sends when it's clicked.
Regards,
CAA14Thats sorted, now how can I stop my three enemys from overlapping when chasing my character?
Fortunately, that's real easy. The problem is that, as far as it sounds, you do not have any layer order, meaning that your enemies aren't in different places as far as back and forth, unless you click on one to bring it to the front. To control what layer a sprite is on, this is the most easy way I know of so far:
When gf clicked Broadcast [layer 1 v] Broadcast [layer 2 v] Broadcast [layer 3 v] Etc...It really doesn't matter where you put the above script, but I would suggest somewhere you will remember, like the stag or main character sprite.
Then, once you have as many layers as you need, then put this in the scripts of all your sprites:When I receive [layer 1 v] go to frontNow remember, your basically stacking the layers, starting at [i]the bottom and stacking to the top[/]. This means that layer 1 is the bottom.
Hope that helps,
CAA14
Right I did the above, I put the code when I receive layer 1 go to front in my first enemy, when I receive layer 2 go to front in second enemy etc. But they still overlap each, all three enemys just go together and look like a single enemy chasing the character?
Offline
scorch2 wrote:
CAA14 wrote:
scorch2 wrote:
Thats sorted, now how can I stop my three enemys from overlapping when chasing my character?Fortunately, that's real easy. The problem is that, as far as it sounds, you do not have any layer order, meaning that your enemies aren't in different places as far as back and forth, unless you click on one to bring it to the front. To control what layer a sprite is on, this is the most easy way I know of so far:
When gf clicked Broadcast [layer 1 v] Broadcast [layer 2 v] Broadcast [layer 3 v] Etc...It really doesn't matter where you put the above script, but I would suggest somewhere you will remember, like the stag or main character sprite.
Then, once you have as many layers as you need, then put this in the scripts of all your sprites:When I receive [layer 1 v] go to frontNow remember, your basically stacking the layers, starting at [i]the bottom and stacking to the top[/]. This means that layer 1 is the bottom.
Hope that helps,
CAA14Right I did the above, I put the code when I receive layer 1 go to front in my first enemy, when I receive layer 2 go to front in second enemy etc. But they still overlap each, all three enemys just go together and look like a single enemy chasing the character?
Hmm... Are you sure that you do not have "go to front" blocks in your scripts? Also, are you clicking on them? That automatically brings them to the front...
Regards,
CAA14
Offline
I have three layers, layer one for the first enemy, layer 2 for the 2nd etc and those blocks have go to front on them but they stuill go on top of each other and I am not clicking on the enemys since they automatically follow the players character until caught.
Offline
scorch2 wrote:
I have three layers, layer one for the first enemy, layer 2 for the 2nd etc and those blocks have go to front on them but they stuill go on top of each other and I am not clicking on the enemys since they automatically follow the players character until caught.
Well, are you broadcasting the layers at the beginning?
I would have to see your scripts to find out the problem know it seems.
Make sure that you change the receiving script to match the layer...
Regards,
CAA14
Last edited by CAA14 (2013-04-27 22:05:52)
Offline