| Make Custom Sprite Knowledge:The jump,spit and hit codes |
|
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - Make Custom Sprite Knowledge:The jump,spit and hit codes |
|
Pages: 1  |
|
|
|
| Posted on 2010-01-29 08:57:32 AM |
Link | Quote |
|
Anybody know the codes for jump,spit and and hit codes??
Anybody know??
I think need to make custom sprite,but need became this easy,but too codes is hard,anybody explain me...
|
|
| Posted on 2010-01-29 09:03:55 AM |
Link | Quote |
|
What?
I do not understand your question. Could you rephrase it?
By "jump," do you mean the sprite itself jumping, or Mario jumping on the sprite?
By "spit," do you mean Yoshi spitting out an enemy?
By "hit," do you mean Mario<->Sprite collision, Sprite<->Sprite collision, Fireball/cape<->Sprite collision, or other?
|
|
| Posted on 2010-01-29 09:07:42 AM |
Link | Quote |
|
JUMP sprite junping on mario
SPIT sprite spit or throwing something
Hit sprite health in custom sprites or bosses
Now understand??
|
| Last edited on 2010-01-29 09:11:43 AM by Roberto zampari. |
|
| Posted on 2010-01-29 09:28:58 AM |
Link | Quote |
|
Yup, much more clear.
To make a sprite "jump," you need to set the Y speed ($AA,x) upward (80-FF, 80 being really fast and FF being really slow). SMW's movement routines create a gravity effect automatically.
The hardest part is detecting when to jump. Setting the y speed in midair will cause a midair jump, which your probably do not want. Setting the Y speed always will just shoot the sprite into the air without ever coming down.
Here is a simple block of code that will make the sprite jump whenever it touches the ground.
Code
LDA $1588,x ; don't set speeds if not on the ground
AND #$04 ;
BEQ NOT_ON_GND ;
LDA #$D0 ; y speed = D0
STA $AA,x ;
NOT_ON_GND:
Making it wait before jumping will require a timer.
To make a sprite shoot another sprite, you will have to spawn a new one and set its speed. Download a shooter sprite of some sort from the sprites section and look at the code it uses to spawn sprites. That should teach you more than I can explain here.
Health is a difficult thing to do if you're just starting out. First we must know if damage can be caused by mario jumping on your sprite, by having a sprite (such as a shell) being thrown at it, or by being hit with a fireball or cape. All three things are coded quite differently.
|
| Last edited on 2010-01-29 09:36:07 AM by Kaijyuu. |
|
| Posted on 2010-01-29 12:35:55 PM |
Link | Quote |
|
|
Anybody understand to health custom sprite??
|
|
| Posted on 2010-01-29 04:49:18 PM |
Link | Quote |
|
|
Most people will use $1528 for health. just DEC or INC to a number and when that number STZ $14C8.
|
|
| Posted on 2010-01-29 10:37:05 PM |
Link | Quote |
|
Originally posted by IxtabMost people will use $1528,x for health. just DEC or INC to a number and when that number STZ $14C8,x.
Fixed.
Also, you'd be better off setting $14C8,x to something like 2 or 4 or just running a separate 'Death' routine when $1528,x is 0.
|
|
| Posted on 2010-01-31 05:28:21 PM |
Link | Quote |
|
Help!!! I have lots of custom sprites, how do I put them into the game?
|
|
| Posted on 2010-01-31 05:30:36 PM |
Link | Quote |
|
Originally posted by Crystal ClearHelp!!! I have lots of custom sprites, how do I put them into the game? 
You're hijacking the thread for something completely unrelated. Please refrain from doing this in the future.
Thanks.
|
|
| Posted on 2010-02-05 12:09:50 PM |
Link | Quote |
|
Health for custom sprite code
1 hit
2 hit
3 hit or
4 hits...
What code use??
|
|
| Posted on 2010-02-05 03:18:25 PM |
Link | Quote |
|
Originally posted by Roberto zampariHealth for custom sprite code
1 hit
2 hit
3 hit or
4 hits...
What code use??
Your method of getting hewlp is rather bad...
First of all, talk in complete sentences, I can barely understand you.
Second, ASM is very difficult, asking people how to do large routines won't get your anywhere, especially with how vague your being. Try reading Iceguy's tutorial in the tutorial section.
|
|
| Posted on 2010-02-28 09:19:31 AM |
Link | Quote |
|
In sprite tutorial,where should put in main routine??
;===================================
;Sprite Function
;===================================
RETURN: RTS
SpriteCode:
JSR Graphics
LDA $14C8,x ;\
CMP #$08 ; | If sprite dead,
BNE RETURN ;/ Return.
LDA $9D ;\
BNE RETURN ;/ If locked, return.
JSR SUB_OFF_SCREEN_X0 ; Handle offscreen.
LDA $1588,x
AND #$03
BEQ NoFlip
LDA $157C,x
EOR #$01
STA $157C,x
NoFlip:
LDY $157C,x
LDA XSPD,y
STA $B6,x
JSL $01802A
JSL $01A7DC
BCC skip
jsl $00f5b7
skip:
RTS
XSPD: dcb $08,$F8
|
| Last edited on 2010-02-28 10:42:34 AM by Roberto zampari. |
|
| Posted on 2010-02-28 10:24:49 AM |
Link | Quote |
|
|
I guess you're supposed to put it after the first RTL in the MAIN routine.
|
| Last edited on 2010-02-28 10:25:01 AM by WhiteYoshiEgg. |
|
|
Pages: 1  |
|
|
|
|
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - Make Custom Sprite Knowledge:The jump,spit and hit codes |