Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Make game harder every x kills.
- Username711
- New to Scratch
7 posts
Make game harder every x kills.
How do I make it so that every 25 kills (variable), I'll add 1 to enemy speed (variable).
Cheers
Cheers
- BotanAI
- Scratcher
100+ posts
Make game harder every x kills.
This is actually a toughie. I'll tell you what I would do, but another scratcher probably has an easier method.
I'd make a third variable called “difficultykills”
Whenever kills would go up by one, I would have “difficultykills” also go up by one.
Somewhere, I'd have:
Forever:
If difficultykills > 24:
set difficultykills to 0
change enemyspeed by 1
I'd make a third variable called “difficultykills”
Whenever kills would go up by one, I would have “difficultykills” also go up by one.
Somewhere, I'd have:
Forever:
If difficultykills > 24:
set difficultykills to 0
change enemyspeed by 1
some really annoying person
- super_crazy
- Scratcher
100+ posts
Make game harder every x kills.
I believe you could also use the following script. Basically when and where you increase the variable “kills” add a block which checks if kills can go evenly into 25 (or whatever you want) using the “mod” block.
Eg:
The ‘mod’ block returns the remainder of two numbers divided together. Therefore you can see if 25 kills has happened by checking if the remainder of “kills” divided by 25 is 0.
@BotanAI's way would work as well however I thought I would just show another solution.
I hope that made sense
Eg:
... :: grey // Where you increase kills
change [kills v] by (1)
if <((kills) mod (25)) = [0]> then // This checks if kills is a multiple of 25
change [enemy speed v] by (1) // If it is we increase the enemy speed
end
... :: grey
The ‘mod’ block returns the remainder of two numbers divided together. Therefore you can see if 25 kills has happened by checking if the remainder of “kills” divided by 25 is 0.
@BotanAI's way would work as well however I thought I would just show another solution.
I hope that made sense
- Teikyde
- Scratcher
10 posts
Make game harder every x kills.
I may have a idea…
> make a variable. In this case “KillCounter”.
Start the game off with very little enemies., However, for every kill, add more enemies and new types of attacks.
So when you have high amounts of kills, the game gets very hard…
(I know, it isn't time efficient)
basically this:
(Sprite 1)
(Sprite 2)
> make a variable. In this case “KillCounter”.
Start the game off with very little enemies., However, for every kill, add more enemies and new types of attacks.
So when you have high amounts of kills, the game gets very hard…
(I know, it isn't time efficient)
basically this:
when green flag clicked
[scratchblocks]
set [ KillCOunterv] to [0]
[/scratchblocks]
when green flag clickedend
[scratchblocks]
forever
if <[Kills] < [KillCounter]> then
set [KillCounter v] to [Kills]
end
[/scratchblocks]
(Sprite 1)
when green flag clicked
forever
go to x: (0) y: (0)
point towards [mouse pointer v]
repeat until <touching [edge v] ?>
move (10) steps
end
end
(Sprite 2)
when green flag clicked
wait until <[KillCounter] = [1]>
forever
go to x: (0) y: (0)
point towards [mouse pointer v]
repeat until <touching [edge v] ?>
move (10) steps
end
- HoofEMP
- Scratcher
100+ posts
Make game harder every x kills.
@super_crazy has a good method. The mod stub is what you'd default to in most situations like this. You could also put this block somewhere:
set [enemy speed v] to ([floor v] of ((kills) / (25)))
- Discussion Forums
- » Help with Scripts
- » Make game harder every x kills.