naruter wrote:
i need help to make like a level (when hero comes to end of room background changes)
*Player* wait until <touching [edge]?> broadcast [next level] *Stage* when I receive [next level] switch to background [wanted background]
Is that what you're looking for?
Offline
'sup, how do i make an enemy able to move backwards and forwards and when my sprite is touching attack, hurting my sprite also how do i make a health bar to show it and also if my sprite were to die as a result of no more health how would i be able to show it then make it start the level again?
plus, scratch is awesome.
Offline
'sup, how do i make an enemy able to move backwards and forwards and when my sprite is touching attack, hurting my sprite also how do i make a health bar to show it and also if my sprite were to die as a result of no more health how would i be able to show it then make it start the level again, lastly, how do i program it so that when my sprite reaches the end of the screen the background changes?
plus, scratch is awesome.
Offline
1. To make an enemy move backwards and forwards, use this script in the enemy.
when green flag clicked
forever [
repeat 50 [
change x by 1
]
repeat 50 [
change x by -1
]
]
2. If your sprite is touching "attack" and you want it to hurt your sprite, use this script in your sprite.
when green flag clicked
set health to 50
forever [
if <touching attack> [
change health by -5
wait until <not <touching attack>>
]
]
3. Instead of using a health bar, I suggest you just show the health variable.
4. To show your sprite's death and then restart the level, use this script in the sprite.
when green flag clicked
show
forever [
if <<health> less than 1> [
go to start
set health to 50
]
]
5. When you reach the end of a level, use these scripts to change the background. Put this script in the sprite.
when green flag clicked
forever [
if <touching color (put end color here)> [
broadcast NEXTLVL
go to start
]
]
Put this script in the stage.
When I receive NEXTLVL
next background
I hope this helps!
Last edited by HD123 (2011-05-28 12:24:38)
Offline