トピック
Łσηеsταг DonTheSuperGamer

I request assistance!

I am making Pac-Man and my ATTR codw for rotation of the sprite is not working. Here is the code. @PACMAN IF BUTTON()==1 THEN PACMANY=PACMANY-1:ATTR=3 IF BUTTON()==2 THEN PACMANY=PACMANY+1:ATTR=1 IF BUTTON()==4 THEN PACMANX=PACMANX-1:ATTR=2 IF BUTTON()==8 THEN PACMANX=PACMANX+1:ATTR=0 SPOFS 0,PACMANX,PACMANY WAIT 1 GOTO @PACMAN If anyone can help me, I would appreciate it.
1そうだね
プレイ済み
返信[1]
親投稿
OlOOlOOl pi_r_round
It seems that you're setting ATTR but then you're not doing anything with it.
0そうだね
プレイ済み
返信[2]
親投稿
OlOOlOOl pi_r_round
You can rotate the sprite using the SPROT command, but you'll have to convert your ATTR to degrees.
2そうだね
プレイ済み
返信[3]
親投稿
OlOOlOOl pi_r_round
Here's some sample code.
1そうだね
プレイ済み
返信[4]
親投稿
DasEtwas MyTheo00
Use SPROT 0, ATTR*90
1そうだね
未プレイ
返信[5]
親投稿
Łσηеsταг DonTheSuperGamer
It seems to let him rotate. There's just one problem. The rotation is rough. I believe it rotates on the top-left corner of the sprite. Do you know how I can get it to rotate on the center of the sprite?
1そうだね
プレイ済み
返信[6]
親投稿
raimondz raimondxz
You need to use sphome first using half width and height as parameters.
2そうだね
プレイ済み
返信[7]
親投稿
Try "SPHOME 0,8,8"
2そうだね
プレイ済み
返信[8]
親投稿
Łσηеsταг DonTheSuperGamer
It works! Thank you, guys! What could I do without your support?
3そうだね
プレイ済み