top of page
Search

scratch basics

in this post , we will go through most of the main blocks in scratch , let's go.


first i'll create a simple project

ree

this block of code makes the sprite moves 10 sprites forward when the green flag is clicked. now let's move on to something harder (for this example , i'll make a mouse trail) .



ree

this is a very simple mouse trail (it makes the sprite go to the mouse)


let's spice it up a bit with some more blocks of code.



ree

check it out yourself in mouse trail 1


let's spice it up even more


ree

this one is mouse trail 2


now let's make it even better.


ree


play here : mouse trail


now that you know the very basic blocks of scratch , lets make a cat vs mouse game (final project for this post)


first let's make the mouse. :D



ree

that'll be the movement of the mouse.


ree

obstacle sensing , points given and movement etc. for the mouse


code for food :

ree


i'll break this down slowly, if touching mouse1 means if touching the mouse(player) , delete this clone means delete the food that touched the mouse. go to random position teleports the food to random position.



ree



rocks have simmiliar code (above)



ree


cat (above)'s code is quite simple. the only new thing is broadcast and stop all.

play it here : cat vs mouse

 
 
 

Comments


  • Facebook
  • Twitter
  • LinkedIn

©2021 by dave-cba. Proudly created with Wix.com

bottom of page