Banner
Views: 1,002,890,673
Time:
20 users online: af1899, Brakkie, E-man38,  Eevee, elegist,  Fernap, Green Jerry, Infinity,  Lazy, LiamBLOL, Neidave, OEO6, PhantasyReal, rafaelfutbal, Random Internet Name, Retro-Hax, Saela, Sammmoo, The_Uber_Camper, VinylHeart - Guests: 91 - Bots: 192 Users: 54,815 (2,031 active)
Tip: Be aware that if you put a coin over a question block, unless you apply this hex edit, it will create an invisible solid block above the ? Block if the block is hit first.
Not logged in.
SMB2 Cobrat by failstream
Forum Index - Valley of Bowser - Moderation Questions - Sprites - SMB2 Cobrat by failstream
Pages: « 1 » Link
File Name: SMB2 Cobrat
Submitted: by failstream
Authors: failstream
Tool: PIXI
Type: Standard
Dynamic: No
Disassembly: No
Includes GFX: Yes
Description: The Cobrat from SMB2 that can be ridden and shoots projectiles. This sprite uses four extra bytes that can determine various behavior. I also commented various spots in the sprite where the behavior could be expanded upon (if you know ASM), but since this is the first sprite I've made I might have overlooked something. When using the first 4 behaviors you will want to place the sprite under a map16 tile with priority on.

Byte 1 determines main behavior of the Cobrat.
00) Normal: Waits until Mario approaches, then jumps out and starts running around.
01) Normal w/Projectile
02) Pipe: Stays under ground and pops up every once in awhile based on a timer.
03) Pipe w/Projectile
04) Running: Runs along ground turning around when it encounters a wall or sprite

Bytes 2-4 determine extra options while in the running behavior.

Byte 2: Timer between shooting projectiles. Due to the animation timer anything below 09 will look strange or it won't shoot.

Byte 3: Timer between jumps while on the running. Cobrats won't jump unless touching the ground.

Byte 4: Determines the height the Cobrat jumps. 00 is default height.
Screenshots:
While it is a nice sprite on its own, the problem is that hiding Cobrats don't disappear behind the foreground which means they only work on high priority tiles (which quicksand is but vanilla pipes usually aren't), "pipe" cobrats aren't corrected in their X position (as you'd imply with "pipe") and lastly, the code is... not very clean.

Regarding the latter point, the main problem is that you don't have to save every single byte but more code can be put inline. I also have noticed that you separate the main code into states and it's the subroutines which differenciate between the individual behaviours which is neither clean nor fast nor might even save insertion size!
Sprites are heavy on cycles which is why you should optimise for speed (which results in clean code), not for byte count. Especially the uses of ExecutePtrs really makes the Cobrat slower than it should have been.
Pages: « 1 » Link
Forum Index - Valley of Bowser - Moderation Questions - Sprites - SMB2 Cobrat by failstream

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


Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

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