Views: 1,002,974,664
14 users online: alviiiN, Cal-of-Gearva, CircleFriendo, ElectroWellyGames, Fox899, GRIMMKIN, Heraga, jorge144p, Maw, MORC, rachmaninov, Ringo, SpoodahBro, UTF - Guests: 94 - Bots: 300 Users: 54,821 (2,030 active)
Tip: If your level contains elements that temporarily change the music to a global song (such as a P-Switch or a Star), that music will not stop playing after the intended end time if the music bypass setting is set to 00.
Not logged in.
Sling Pack by NerDose
Forum Index - Valley of Bowser - Moderation Questions - Sprites - Sling Pack by NerDose
Pages: « 1 » Link
File Name: Sling Pack
Submitted: by NerDose
Authors: NerDose
Tool: PIXI
Type: Standard
Dynamic: No
Disassembly: No
Includes GFX: Yes
Description: This sling pack contains four different slings: The silver sling shoots diagonally and drags mario up, the Golden sling shoots horizontally and acts as a swing, the blue sling shoots vertically and acts as a rope and the red sling shoots horizontally and spawns a platform.
Be sure to put the file "GetDistanceSprMario.asm" in PIXI's routines folder.

Despite being a nice set of sprites, there is unfortunatelly one fundamental flaw with the Gold Sling:

It is very easy to kill yourself with a Gold Sling if you move very fast and the distance between Mario and the sling is rather high. One possible solution is to slow the sling's speed with a big radius or add in fractional values.

In addition, but not rejection worthy, some of the code can be improved as well.

The best can be seen at the Gold Sling
LDA $7B  ;store mario x speed in freeram 00
STA $00
BPL .ignore ;if number is negative
LDA $00 ;make it a positive number
STA $00
LDA $00 ;load freeram 00
CMP #$12 ;if less than 12 (walking)
BCC twoSpeed ;slow initial speed
CMP #$2E ;if less than 2E (runnung)
BCC threeSpeed ;medium initial speed
BRA fourSpeed ;else fast initial speed


;this is getting boring to comment 
;this stuff just stores the initial speeds to a free sprite table
;then jumps back to the code

LDA #$02
STA !187B,x
JMP RotSpeedDone

LDA #$04
STA !187B,x
JMP RotSpeedDone

LDA #$06
STA !187B,x
JMP RotSpeedDone

I see three mistakes here: You don't have to store the speed into scratch RAM at all, you can use Y, which is free to use outside of the graphics routine, for the angle speed instead of using branches for each speed (either store it directly or use it for an index to a table) and RotSpeedDone points to a RTS meaning it's actually faster and smaller to just use RTSs instead of JMPs.

I also see very often cases like
JMP DoSomething


which is to be avoided unless absolutely necessary. I know, you sometimes use it to have a spin jump from the regular jump when releasing from a sling but there is a better way to do it. (Hint: Check for $18 first and then $16 as bits 6 and 7 of $18 are or'd with $16.)

Some smaller subroutines may be better to have them inline instead of as an actual subroutine (e.g. AimingToMario).

Lastly, disabling the controls isn't possible within a sprite as Mario's physics run before any sprite is handled (you still can turn with the Gold Sling). You can only disable them before (such as with UberASM).
Pages: « 1 » Link
Forum Index - Valley of Bowser - Moderation Questions - Sprites - Sling Pack by NerDose

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

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


Follow Us On

  • YouTube
  • Twitch
  • Twitter


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