-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbayraklar.kojo
38 lines (33 loc) · 1.21 KB
/
bayraklar.kojo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// This sample shows you how to use costumes, backgrounds, and sounds
// When we give a turtle a costume that looks nothing like a turtle, we informally
// call it a sprite
// To access and play with many different costumes, backgrounds, and sounds,
// you can download (and unzip) the following media zipfile:
// code.google.com/p/kojo/downloads/detail?name=scratch-media.zip
// If that link fails, find it in the second page here:
// https://code.google.com/archive/p/kojo/downloads?page=2
clear()
setBackground(Color(200, 200, 200))
// if you want a background image, make it the original turtle's costume
turtle0.setCostume(Background.trainTrack)
val t1 = newTurtle(-50, -180, Costume.womanWaving)
t1.act { self =>
repeatWhile(self.position.y < 40) {
self.changePosition(0.6, 1)
self.scaleCostume(0.995)
pause(0.03)
}
}
val t2 = newTurtle(-250, 180)
t2.setCostumes(Costume.bat1, Costume.bat2)
t2.scaleCostume(0.5)
t2.act { self =>
repeatWhile(self.position.x < 200) {
self.changePosition(10, 0)
self.nextCostume()
pause(0.15)
}
stopAnimations() // stops any ongoing animation or music
}
// play background music in a loop
playMp3Loop(Sound.medieval1)