Banner
Views: 875,020,232
Time:
18 users online: 0ne_bins211, Abstract, Anas, anonimzwx,  Atari2.0, cocozone, Dark4ssass1n, GGMadMan, Infinity,  KevinM,  MarioFanGamer, OnlySpaghettiCode, princess98, qantuum, raiden87, StackDino,  Tahixham,  Telinc1 - Guests: 71 - Bots: 67 Users: 48,791 (2,458 active)
Latest: cocozone
Winter C3 2021 Content Spotlight
Mirann's "SMAS-Styled Hack" Demo!
Not logged in.
Make Custom Sprite Knowledge:The jump,spit and hit codes
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - Make Custom Sprite Knowledge:The jump,spit and hit codes
Pages: « 1 » Link
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...
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?
JUMP sprite junping on mario
SPIT sprite spit or throwing something
Hit sprite health in custom sprites or bosses

Now understand??
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.
Anybody understand to health custom sprite??
Most people will use $1528 for health. just DEC or INC to a number and when that number STZ $14C8.

--------------------

Originally posted by Ixtab
Most 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.

--------------------
Now with extra girl and extra hacker
Help!!! I have lots of custom sprites, how do I put them into the game? :(

--------------------
Bye...
Originally posted by Crystal Clear
Help!!! 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.

--------------------
--------> Don't follow "Find Roy's Dignity", my hack. Because it's pretty outdated. <--------
Health for custom sprite code
1 hit
2 hit
3 hit or
4 hits...

What code use??
Originally posted by Roberto zampari
Health 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.
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
I guess you're supposed to put it after the first RTL in the MAIN routine.

--------------------


 
Pages: « 1 » Link
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - Make Custom Sprite Knowledge:The jump,spit and hit codes

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2021 - SMW Central
Legal Information - Privacy Policy - Link To Us


Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

  • Super Mario Bros. X Community
  • ROMhacking.net
  • Mario Fan Games Galaxy
  • sm64romhacks