プレイ日記
José A. jose12alex
Can somebody help me? Im trying to make a snake game, i already made the controls and the snake (wich is just squares) but i dont know how to make it so the "tail" dissappears acording to the score (Score=1 then theres only two squares). Here are the details: -Theres a SCORE variable. -I made XE and YE variables to locate where to print a black square so the "tail" dissappears. [Character Limit]
1そうだね
プレイ済み
返信[1]
親投稿
José A. jose12alex
-I made a locate randomizer for the point to eat (◆), and i want the program to detect when the snake (Square) touches it. The cordenates have variables (XP and YP).
0そうだね
プレイ済み
返信[2]
親投稿
José A. jose12alex
-My objective is to make it so the only amount of squares are SCORE=1 and also the comment above this one.
0そうだね
プレイ済み
返信[3]
親投稿
José A. jose12alex
I mean SCORE+1
0そうだね
プレイ済み
返信[4]
親投稿
José A. jose12alex
-What i mean and want to happen is: if ■ touches ◆ then SCORE+1 only SCORE+1 amount of ■'s Which means if SCORE=3 then there will only be 4 ■'s.
0そうだね
プレイ済み
返信[5]
親投稿
Bonzargoes cactusfriend
I'd define a length var, then use a while or for loop to draw the snake at the right length.
0そうだね
プレイ済み
返信[6]
親投稿
José A. jose12alex
Sorry to be ignorant but... Explain
0そうだね
プレイ済み
返信[7]
親投稿
Bonzargoes cactusfriend
Well, for instance, you could do something like: have a 'redraw' part in the main @loop that checks to see how many steps the snake has taken and what length it should be, and then 'remove' the ones that are 'stale'. I know there's a built-in counter in smilebasic but in this case you'd probably just want to set one yourself: just do like c=0 before the @loop, and then do a C + 1.
0そうだね
プレイ済み