-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
tatarski
committed
Aug 4, 2021
1 parent
32ad6a5
commit e119144
Showing
3 changed files
with
27 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,26 @@ | ||
// 0. Suzdavame promenlivi | ||
let myX, myY; | ||
|
||
// Suzdavame promenlivi | ||
let myX, myY, gosho = []; | ||
function init() { | ||
// 1. Kodut tuk se izpulnqva vednuj v nachaloto | ||
// Kodut tuk se izpulnqva vednuj v nachaloto | ||
myX = 300; | ||
myY = 300; | ||
} | ||
|
||
function update() { | ||
// 2. Kodut tuk se izpulnqva (okolo) 100 puti v sekunda | ||
// Kodut tuk se izpulnqva (okolo) 100 puti v sekunda | ||
myX = myX + (mouseX - myX) / 10; | ||
myY = myY + (mouseY - myY) / 10; | ||
} | ||
|
||
function draw() { | ||
// 3. Tuk naprogramirai kakvo da se risuva | ||
// Tuk naprogramirai kakvo da se risuva | ||
drawImage(backDesert, 0, 0, 800, 600); | ||
drawImage(femaleAction, myX, myY, 60, 80); | ||
context.fillText("GOSHO", 50, 50); | ||
} | ||
|
||
function mouseup() { | ||
// Pri klik s lqv buton - pokaji koordinatite na mishkata | ||
console.log("Mouse clicked at", mouseX, mouseY); | ||
} | ||
function keyup(key) { | ||
// 4. Pechatai koda na natisnatiq klavish | ||
// Pechatai koda na natisnatiq klavish | ||
console.log("Pressed", key); | ||
} | ||
|
||
function mouseup() { | ||
// 5. Pri klik s lqv buton - pokaji koordinatite na mishkata | ||
console.log("Mouse clicked at", mouseX, mouseY); | ||
} |
Oops, something went wrong.