|
Post by claudiamoral on Oct 23, 2020 9:11:06 GMT
Sorry about my English, I'm new to this and I ask a lot. I have managed to get my sprite to move in all directions, but I don't know how to make the sprites draw diagonally, and I also don't know if the sprite can be made to shoot in all 8 directions (Gauntlet type). It's possible?  AGD 4.8
|
|
|
Post by Packobilly on Oct 24, 2020 8:01:36 GMT
|
|
|
Post by claudiamoral on Oct 24, 2020 15:53:30 GMT
Thank you, little by little we are learning more
|
|
|
Post by ramon on Oct 25, 2020 18:51:37 GMT
Yo uso el MPAGD; pero el fundamento es idéntico. Utiliza una variable para identificar la dirección en la que se está moviendo tu jugador. por ejemplo A = DIRECTION. Para cambiar la imagen de tu Sprite: LET FRAME = A Si colocas los frames en grupos correlativos los podrás animar también. Otra opción es crear 8 sprites con sus respectivos frames: LET IMAGE = A Las opciones en este punto quedan a tu elección.
Cuando dispares le pasas ese valor al spawned bullet, por ejemplo asi:
IF KEY FIRE
IF F = 0
SPAWN 1 8 ; CREA UN SPRITE TIPO 1 CON UNA IMAGEN 8 SPAWNED
LET DIRECTION = A ; EN EL AMBITO DEL SPRITE CREADO COLOCA LA DIRECCION QUE LE HEMOS PASADO ENDSPRITE
LET F = 1
;BEEP 30
ENDIF
ELSE
LET F = 0
ENDIF En tu bullet: Yo he usado las direcciones 0,32,64,96,128,160,192,224. puedes usar 1,2,3,4,5,6,7,8. o como quieras. Tambien puedes usar una imagen por dirección o un Sprite simétrico. tu ya decides.
IF DIRECTION= 0
SPRITEUP
EXIT
ENDIF
IF DIRECTION= 64
SPRITERIGHT
EXIT
ENDIF
IF DIRECTION= 128
SPRITEDOWN
EXIT
ENDIF
IF DIRECTION= 192
SPRITELEFT
EXIT
ENDIF
IF DIRECTION= 32
SPRITERIGHT
SPRITEUP
ENDIF
IF DIRECTION= 96
SPRITERIGHT
SPRITEDOWN
ENDIF
IF DIRECTION= 160
SPRITELEFT
SPRITEDOWN
ENDIF
IF DIRECTION= 224
SPRITELEFT
SPRITEUP
ENDIF
|
|
|
Post by claudiamoral on Oct 26, 2020 10:03:08 GMT
Thank you very much, I'm going to try it, see if it works out for me. I already inform you 
|
|