We've just updated MediaWiki and its underlying software. If anything doesn't look or work quite right, please mention it to us. --RanAS

User:Anonimzwx/Dyzen Sprite Maker (Spanish): Difference between revisions

From SnesLab
Jump to: navigation, search
No edit summary
No edit summary
Line 36: Line 36:
Las acciones de las hitboxes son pequeños trozos de código que son ejecutados cuando cierta hitbox colisiona con el player. De momento solo funcionan con el player, a futuro se implementaran para interacción sprite<->sprite.  
Las acciones de las hitboxes son pequeños trozos de código que son ejecutados cuando cierta hitbox colisiona con el player. De momento solo funcionan con el player, a futuro se implementaran para interacción sprite<->sprite.  


'''Nota:''' Todas las siguientes acciones funcionan solo en el videojuego Super Mario World.
<code>'''Nota:''' Todas las siguientes acciones funcionan solo en el videojuego Super Mario World.</code>


Antes que todo debemos considerar que el tool permite tener multiples hitboxes, debido a esto existen 2 tipos de acciones:
Antes que todo debemos considerar que el tool permite tener multiples hitboxes, debido a esto existen 2 tipos de acciones:
Line 48: Line 48:
</pre>
</pre>


'''Nota:''' Existe un bug en que si editas la acción default desde el editor de código y vuelves a recargar el codigo, volvera a su estado inicial, por lo tanto, se recomienda editar esta en el archivo generado al hacer "Extract Resources" y no en el editor de codigo del tool.
<code>'''Nota:''' Existe un bug en que si editas la acción default desde el editor de código y vuelves a recargar el codigo, volvera a su estado inicial, por lo tanto, se recomienda editar esta en el archivo generado al hacer "Extract Resources" y no en el editor de codigo del tool.</code>


Y las acciónes no default, que son creadas en el apartado de interacción por el usuario, por ejemplo:
Y las acciónes no default, que son creadas en el apartado de interacción por el usuario, por ejemplo:

Revision as of 01:59, 21 May 2019

Introducción

Dyzen Sprite Maker es un tool creado por Anonimzwx perteneciente a SNES Office que facilita la creación de enemigos (o cualquier objeto que use tiles de la OAM), originalmente fue hecho para el videojuego Super Mario World, pero hay planes para que funcione con otros videojuegos.

Las funcionalidades de esta herramienta son las siguientes:

  • Creación de la rutina gráfica.
  • Creación de animaciones.
  • Creación de cajas de colisión.
  • Generador automático de código ASM con editor.

Video-Tutoriales

Por el momento se encuentran los siguientes tutoriales:

Colaboración

El Github de Dyzen es el siguiente:

https://github.com/weierstrass1/SMWControlib

Cualquier duda se puede comunicar con Anonimzwx.

Actualmente se busca gente que pueda documentar el sistema de enemigos otros videojuegos para darles soporte

Acciones para Hitbox

Las acciones de las hitboxes son pequeños trozos de código que son ejecutados cuando cierta hitbox colisiona con el player. De momento solo funcionan con el player, a futuro se implementaran para interacción sprite<->sprite.

Nota: Todas las siguientes acciones funcionan solo en el videojuego Super Mario World.

Antes que todo debemos considerar que el tool permite tener multiples hitboxes, debido a esto existen 2 tipos de acciones:

La acción default es la que ejecutaria la mayoria de las cajas de colisión y que es autogenerada por el tool y que se veria asi:

DefaultAction:
    ;Here write the code
    RTS

Nota: Existe un bug en que si editas la acción default desde el editor de código y vuelves a recargar el codigo, volvera a su estado inicial, por lo tanto, se recomienda editar esta en el archivo generado al hacer "Extract Resources" y no en el editor de codigo del tool.

Y las acciónes no default, que son creadas en el apartado de interacción por el usuario, por ejemplo:

notDefaultAction:
    LDX !SpriteIndex
    ;Here write the code.
    RTS

A continuación algunos códigos de ejemplo que pueden utilizarse, estos deben ser puestos en la zona que dice ;Here you can write your action code:

Dañar al player

Daña al jugador cuando toca la hitbox.

    JSL $00F5B7|!rom

Matar al player

Mata al jugador cuando toca la hitbox.

    JSL $00F606|!rom

Interacción Default

Si el player salta sobre la hitbox, es impulsado para arriba, en otro caso es dañado.

Puedes reemplazar ;Here you can call a routine to damage the sprite by normal jump por alguna rutina para dañar o matar al sprite por salto normal.

Puedes reemplazar ;Here you can call a routine to damage the sprite by spin jump. por alguna rutina para dañar o matar al sprite por spin jump.

    LDA $1490|!addr
    BEQ +
 
    JSL StarKill    ;If mario have star then kill the sprite using the STAR, it use GIEPY
    RTS
 
+
 
    LDA !PlayerYSpeed
    BPL +++             ;If Player Y Speed is Negative then damage player
    JSL $00F5B7|!rom
RTS
 +++
    STZ !ScratchD
    LDA !Scratch3
    STA !ScratchC
 
    LDA !Scratch9
    XBA
    LDA !Scratch1
    REP #$20
    CLC
    ADC !ScratchC
    SEC
    SBC #$0008
    STA !ScratchC       ;Obtain the position of the lowest 8 pixels of mario
    SEP #$20
 
    LDA !ScratchB
    XBA
    LDA !Scratch5
    REP #$20
    CMP !ScratchC
    SEP #$20            ;If the interaction happend using only the lowest 8 pixels of the player
    BCS +++             ;And player Y speed is positive then start normal kill
	JSL $00F5B7|!rom
RTS
+++
 
    JSL $01AB99|!rom    ;Spawn a White Star bellow mario
    JSL $01AA33|!rom    ;Boost Player Y Speed

    LDA $140D|!addr
    BEQ +

    ;Here you can call a routine to damage the sprite by spin jump.
    RTS

+
    JSR JumpSound
    ;Here you can call a routine to damage the sprite by normal jump
    RTS

JumpSound:
    PHY                      
    LDA $1697|!addr              
    CLC                      
    ADC !SpriteMiscTable13,x            
    INC $1697|!addr                
    TAY                      
    INY                      
    CPY.B #$08                
    BCS +          
    LDA Return01A61D,y      
    STA $1DF9|!addr               ; / Play sound effect
+
    TYA                      
    CMP #$08                
    BCC +          
    LDA #$08                
+
    JSL $02ACE5|!rom      
    PLY                      
    RTS                       ; Return
 
Return01A61D:
    RTS                       ; Return
 
 
DATA_01A61E:
    db $13,$14,$15,$16,$17,$18,$19 

Interacción Solida

La hitbox actúa como si fuera un bloque solido con el player.

	LDA !PlayerYSpeed
	STA !ScratchF
	STZ !ScratchE
	LDA !PlayerYSpeed
	BMI +++
	
	STZ !ScratchD
	LDA !Scratch3
	STA !ScratchC

	LDA !Scratch9
	XBA
	LDA !Scratch1
	REP #$20
	CLC
	ADC !ScratchC
	SEC 
	SBC #$0008
	STA !ScratchC
	SEP #$20

	LDA !ScratchB
	XBA
	LDA !Scratch5
	REP #$20
	CMP !ScratchC
	BCS +
	JMP .sides
+
	PHA
	LDA !ScratchC
	SEC
	SBC $01,s
	ADC #$0008
	STA !ScratchC
	PLA
	LDA !PlayerY
	SEC
	SBC !ScratchC
	STA !PlayerY

	SEP #$20

	LDA !PlayerBlockedStatus_S00MUDLR
	ORA #$04
	STA !PlayerBlockedStatus_S00MUDLR
	STZ !PlayerInAirFlag
	LDA #$01
    STA $1471|!base2
	RTS
+++
	SEP #$20
	STZ !ScratchD
	LDA !Scratch7
	STA !ScratchC

	LDA !ScratchB
	XBA
	LDA !Scratch5
	REP #$20
	CLC
	ADC !ScratchC
	SEC 
	SBC #$0008
	STA !ScratchC
	SEP #$20

	LDA !Scratch9
	XBA
	LDA !Scratch1
	REP #$20
	CMP !ScratchC
	BCC +++

	SEP #$20

	LDA #$08
	STA !PlayerYSpeed
	LDA #$01
	STA !ScratchE

	LDA !PlayerBlockedStatus_S00MUDLR
	ORA #$08
	STA !PlayerBlockedStatus_S00MUDLR
+++
.sides
	SEP #$20

	LDA !PlayerXSpeed
	BMI +++

	STZ !ScratchD
	LDA !Scratch2
	STA !ScratchC

	LDA !Scratch8
	XBA
	LDA !Scratch0
	REP #$20
	CLC
	ADC !ScratchC
	SEC 
	SBC #$0008
	STA !ScratchC
	SEP #$20

	LDA !ScratchA
	XBA
	LDA !Scratch4
	REP #$20
	CMP !ScratchC
	BCC ++

	PHA
	LDA !ScratchC
	SEC
	SBC $01,s
	ADC #$0008
	STA !ScratchC
	PLA
	LDA !PlayerX
	SEC
	SBC !ScratchC
	STA !PlayerX
	SEP #$20

	STZ !PlayerXSpeed
	LDA !ScratchE
	BEQ +
	LDA !ScratchF
	STA !PlayerYSpeed
	LDA !PlayerBlockedStatus_S00MUDLR
	AND #$F7
	STA !PlayerBlockedStatus_S00MUDLR
+

	LDA !PlayerBlockedStatus_S00MUDLR
	ORA #$01
	STA !PlayerBlockedStatus_S00MUDLR
	RTS
++
	SEP #$20
	LDA !PlayerXSpeed
	BEQ +++
	RTS
+++
	SEP #$20

	STZ !ScratchD
	LDA !Scratch6
	STA !ScratchC

	LDA !ScratchA
	XBA
	LDA !Scratch4
	REP #$20
	CLC
	ADC !ScratchC
	SEC 
	SBC #$0008
	STA !ScratchC
	SEP #$20

	LDA !Scratch8
	XBA
	LDA !Scratch0
	REP #$20
	CMP !ScratchC
	BCC +++

	PHA
	LDA !ScratchC
	SEC
	SBC $01,s
	ADC #$0008
	STA !ScratchC
	PLA
	LDA !PlayerX
	CLC
	ADC !ScratchC
	STA !PlayerX

	SEP #$20

	STZ !PlayerXSpeed
	LDA !ScratchE
	BEQ +
	LDA !ScratchF
	STA !PlayerYSpeed
	LDA !PlayerBlockedStatus_S00MUDLR
	AND #$F7
	STA !PlayerBlockedStatus_S00MUDLR
+

	LDA !PlayerBlockedStatus_S00MUDLR
	ORA #$02
	STA !PlayerBlockedStatus_S00MUDLR
	RTS
+++
	SEP #$20