Banner
Views: 808,078,851
Time:
21 users online:  1UPdudes, akkanben, alexandrite, caiqueleo, Cappaque, chickaDEE Magazine, earthmeLon,  Falconpunch, GatoSlashFish, Golden Yoshi,  KevinM, lion,  Maxodex, Medic, NewPointless,  NeXuS15, Redwykelz, RollingRigatonis, RudeGuy, Sancles, Spads - Guests: 62 - Bots: 233 Users: 42,423 (1,993 active)
Latest: KevinTheDumbCat
Tip: Remember, if you place a moon, midpoint, or Dragon Coin using direct Map16, it will always respawn when you re-enter that sublevel. Use the extended object instead.Not logged in.
LIVE!!
white_moth is now live on Twitch with 64 viewers.
white_moth is streaming, and is currently playing Super Mario World in “KLDC 2020 Judging Day 2”
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 - 2020 - SMW Central
Legal Information - Privacy Policy - Link To Us


Total queries: 7

Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

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