This s only simple, nothing advanced...
To get a sprite to play a sound every 5 seconds, first upload that sound into the sprite, then insert the following code:
when gf clicked forever play sound [sound-name-here v] wait [5] endAlso, to make a sprite move when you press arrow keys, use this script:
when [right arrow v] key pressed point in direction [90 v] move [10] steps end when [left arrow v] key pressed point in direction [-90 v] move [10] steps end(note this only goes left and right, not up and down.)
when [up arrow v] key pressed change y by [10] wait [0.1] change y by [10] wait [0.1] change y by [10] wait [0.1] change y by [10] wait [0.2] change y by [-10] wait [0.1] change y by [-10] wait [0.1] change y by [-10] wait [0.1] change y by [-10] endThis will make it jump more realisticly, but if you want a more simple yet less realistic jump, you can use this:
when [up arrow v] key pressed change y by [40] wait [0.2] change y by [-40] endHope this helped, if you make a project using this information, please reply with a link to it!
Offline
MightyMat wrote:
This s only simple, nothing advanced...
To get a sprite to play a sound every 5 seconds, first upload that sound into the sprite, then insert the following code:when gf clicked forever play sound [sound-name-here v] wait [5] endAlso, to make a sprite move when you press arrow keys, use this script:when [right arrow v] key pressed point in direction [90 v] move [10] steps end when [left arrow v] key pressed point in direction [-90 v] move [10] steps end(note this only goes left and right, not up and down.)
If you want to make it jump you need a more advanced script, similar to this:when [up arrow v] key pressed change y by [10] wait [0.1] change y by [10] wait [0.1] change y by [10] wait [0.1] change y by [10] wait [0.2] change y by [-10] wait [0.1] change y by [-10] wait [0.1] change y by [-10] wait [0.1] change y by [-10] endThis will make it jump more realisticly, but if you want a more simple yet less realistic jump, you can use this:when [up arrow v] key pressed change y by [40] wait [0.2] change y by [-40] endHope this helped, if you make a project using this information, please reply with a link to it!
Don't listen to his advice on moving right. And left. It'll flip your sprite upside down do this:
To move right:
When gf clicked Forever if <[right arrow] key pressed> Change x by [3]3 is just a random number. A higher number will move you faster.
Offline