|
Post by gal ashkenzi on Aug 9, 2021 7:23:30 GMT
game_over = {
player.replay stop
camera.chase player
go.print "GAME OVER": pos(300,300,0) and size 3 and color red
start_button.draw start_button : pos (300,400)
when mouse left is pressed on start_button do
atart_button.draw clear
go.print ""
life=7
score=0
stg=0
camera.attach to player : pos(0,3,-10) and rotate(-15,0,0)
player.replay track3 start at 0 in car_speed seconds : ry offset 180
end do
}
?הנתונים מתאפסים אבל זה לא מתחיל לנסוע מה אני עושה לא נכון בקוד game over כאשר אני מפסיד ומגיע ללחצן
|
|
|
Post by Adi Barda on Aug 9, 2021 14:02:32 GMT
הקוד נראה תקין. תיקנתי לך שגיאת כתיב והוספתי once בלחיצה על העכבר וגם בדקתי וזה נראה עובד נסה את הקוד המתוקן הזה:
game_over = {
player.replay stop camera.chase player go.print "GAME OVER": pos(300,300,0) and size 3 and color red start_button.draw start_button : pos (300,400) when mouse left is pressed once on start_button do start_button.draw clear go.print "" life=7 score=0 stg=0 camera.attach to player : pos(0,3,-10) and rotate(-15,0,0) player.replay track3 start at 0 in car_speed seconds : ry offset 180 end do
}
|
|
|
Post by gal ashkenzi on Aug 10, 2021 9:29:11 GMT
הקוד עדיין לא עובד ובדקתי וגיליתי שאי אפשר גם כפתור התחלה וגם כפתור סיום אז מה אפשר לעשות?
game_over = {
player.replay stop camera.chase player go.print "GAME OVER": pos(300,300,0) and size 3 and color red start_button.draw start_button : pos (300,400) when mouse left is pressed once on start_button do start_button.draw clear go.print "" life=7 score=0 stg=0 camera.attach to player : pos(0,3,-10) and rotate(-15,0,0) player.replay track3 start at 0 in car_speed seconds : ry offset 180 end do
} זה הקוד של הכפתור סיום
go.print "START PLAY": pos(300,300,0) and size 3 and color red
start_button.draw start_button : pos (300,400)
when mouse left is pressed on start_button do
start_button.draw clear go.print "" life=7 score=0 stg=0
end do וזה של ההתחלה
|
|
|
Post by Adi Barda on Aug 10, 2021 9:44:12 GMT
אפשר כמה כפתורים שאתה רוצה רק תן לערוצי ההדפסה שלהם שמות ייחודיים לדוגמא בקוד שלך שיניתי את השם של ערוץ ההדפסה של הכפתור להתחלת משחק לשם ייחודי:
go.print "START PLAY": pos(300,300,0) and size 3 and color red
start_game_button.draw start_button : pos (300,400)
when mouse left is pressed on start_game_button do
start_game_button.draw clear go.print "" life=7 score=0 stg=0
end do
|
|
|
Post by gal ashkenzi on Aug 10, 2021 9:46:30 GMT
אה הבנתי תודה
|
|