Banner
Views: 778,886,992
Time:
3 users online: Darkslayer,  KKevinM, MrDeePay - Guests: 28 - Bots: 177 Users: 40,835 (1,681 active)
Latest: Blugar23
Tip: Read Lunar Magic's help file and SMW Central's FAQ, as they cover most of the basics of SMW hacking.Not logged in.
Problems with sprite clipping [fixed]
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - Problems with sprite clipping [fixed]
Pages: « 1 »
I'm making a sprite and I want it to stop when it walks into a wall.

My code is:

Code
LDA $B6,x	;Load sprite X speed
BEQ RETURN	;If zero do nothing
LDA $B6,x	;Load sprite X speed
BPL POSXSPEED	;Branch if speed is positive
LDA $1588,x	;Load sprite collision byte (or whatever it's called)
AND #$02	;Check second bit (set if blocked from the left)
BEQ RETURN	;If sprite is not blocked do nothing
STZ $B6,x	;Set sprite X speed to zero
JSL $01802A	;Apply speed
RTS		;Return

POSXSPEED:

LDA $1588,x	;Load sprite collision majigger
AND #$01	;Check first bit (set if blocked from the right)
BEQ RETURN	;If sprite is not blocked do nothing
STZ $B6,x	;Set sprite X speed to zero
JSL $01802A	;Apply speed
RTS		;Return


The problem is that the sprite just goes right through everything. It doesn't even care. What do?


Edit: I fixed it by saving the sprite's X-position and restoring it at the end of the MAIN routine if it clipped with something. After that I set the speed to zero and now it works.

We’re looking for level designers to work on Extra Mario World!
Pages: « 1 »
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - Problems with sprite clipping [fixed]

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

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


Total queries: 7

Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

  • Talkhaus
  • SMBX Community
  • GTx0
  • Super Luigi Bros
  • ROMhacking.net
  • MFGG
  • Gaming Reinvented