Banner
Views: 737,601,946
Time:
13 users online: chillyfox, Hiro-sofT, Infinity, JP32, NGB, o Plasmodium00, Romano338, o RPG Hacker, sinseiga, Telinc1, Teyla, UTF, westslasher2 - Guests: 35 - Bots: 175Users: 38,803 (1,931 active)
Latest: rocketfire
Tip: If you plan on making long levels, be sure to include multiple midway points. A patch for this can be found in the Patches section.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: 25

Menu

Follow Us On

  • Facebook
  • Twitter
  • YouTube

Affiliates

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