Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How do you make spikes?
- EpicFangirl21
-
3 posts
How do you make spikes?
sorry i'm new to this and want to create a game sort of like Mario where instead you have to avoid spikes, climb walls, double-jump, and capture a flag. Hopefully there can be 5-6 levels, but i really need help! I would GREATLY appreciate anyone who can help me, and they will definitely be mentioned for helping me. THANK YOU!!!! XD
- Sinaboo
-
100+ posts
How do you make spikes?
Ok what do you need help with? Just spikes for now?
Last edited by Sinaboo (Nov. 13, 2018 22:41:58)
- Vicream_Creator
-
100+ posts
How do you make spikes?
Well “spikes” doesn't exist. Sprites that changes variables does. yeah all i need is spikes for now
Considering you already built your game with Mario having health and all:
Spike (or block/whatever) (I suggest using hitbox if they have a weird design/deco thingies)
when green flag clicked
forever
if <touching [Mario] ?> then
change [HP] by (-1) //Or broadcast DIE,...
broadcast [HURT] and wait //Risky block, I suggest using broadcast and wait .1 sec
end
end
Mario script:
when I receive [HURT]
go to x: (SPAWN) y: (SPAWN)//(You can have add-on such as animations,..)
Note:You can skip Spike script and directly make it so that it is Mario that detects touching the spike
Last edited by Vicream_Creator (Nov. 14, 2018 20:03:30)
- EpicFangirl21
-
3 posts
How do you make spikes?
oh ok thanks…. but like i said im a noob and im still in the process of creating this game. is there anyway i can ask you for how to do hp and other necessities for this game to look and function properly?
- Vicream_Creator
-
100+ posts
How do you make spikes?
Well HP is just a random variable that you can show. You could also render hearts that disappears depending on the HP: oh ok thanks…. but like i said im a noob and im still in the process of creating this game. is there anyway i can ask you for how to do hp and other necessities for this game to look and function properly?
Heart sprites script:
when green flag clicked
set [HP] to [5]
switch costume to [Heart 5]
And then, if you already inserted the lowering HP script in the spikes:
when I receive [HURT]
wait (0.1) secs //Avoid glitches else Spikes won't have time to lower HP
switch costume to (join [Heart ] (HP)
And for basically every other game necessities I suggest copying a random platformer (Games with the aim to teach peoples scripting are always easier to copy from, I suggest using them)
Last edited by Vicream_Creator (Nov. 14, 2018 21:06:45)
- CreakyRobot175
-
0 posts
How do you make spikes?
A simpler way to do it is
forever
if <> then
<touching [spikes v] ?>
end
end
[scratchblocks]
when green flag clicked
[/scratchblocks]
- Tishmish
-
4 posts
How do you make spikes?
you can try to do this too:-make one sprite that looks like a spike,then do this to the moving sprite,
when green flag clicked
forever
if <> then
<touching [ v] ?>
go to x: () y: (0)
end
end
- PersRufaro
-
100+ posts
How do you make spikes?
A simpler way to do it isforever
if <> then
<touching [spikes v] ?>
end
end
[scratchblocks]
when green flag clicked
[/scratchblocks]
repeat ()
forever
if <> then
if <> then
wait until <>
repeat until <>
<key [<touching color [#c6efd9] ?><touching color [#c6efd9] ?><color [#d476ff] is touching [#f203e3] ?>(loudness) v] pressed?>
play sound [ v] until done
play note ( v) for (0.5) beats
if <> then
if <> then
pen up
set pen color to [#a13c1d]
change pen color by ()
stamp
say []
think []
show
end
end
end
else
end
end
end
end
you can try to do this too:-make one sprite that looks like a spike,then do this to the moving sprite,when green flag clicked
forever
if <> then
<touching [ v] ?>
go to x: () y: (0)
end
end
[/quote]
Please don’t necropost. It’s when you post on an old topic and it brings it back to the top of the forum
- PersRufaro
-
100+ posts
How do you make spikes?
A simpler way to do it isforever
if <> then
<touching [spikes v] ?>
end
end
[scratchblocks]
when green flag clicked
[/scratchblocks]repeat ()
forever
if <> then
if <> then
wait until <>
repeat until <>
<key [<touching color [#c6efd9] ?><touching color [#c6efd9] ?><color [#d476ff] is touching [#f203e3] ?>(loudness) v] pressed?>
play sound [ v] until done
play note ( v) for (0.5) beats
if <> then
if <> then
pen up
set pen color to [#a13c1d]
change pen color by ()
stamp
say []
think []
show
end
end
end
else
end
end
end
endyou can try to do this too:-make one sprite that looks like a spike,then do this to the moving sprite,when green flag clicked
forever
if <> then
<touching [ v] ?>
go to x: () y: (0)
end
end
[scratchblocks]
[/quote]
Please don’t necropost. It’s when you post on an old topic and it brings it back to the top of the forum[/quote]
- Discussion Forums
- » Help with Scripts
-
» How do you make spikes?