Romhacking => ROM Hacking Discussion => Topic started by: PolishedTurd on June 19, 2021, 11:28:30 pm

Title: NES: Animate a horizontal or vertical rope
Post by: PolishedTurd on June 19, 2021, 11:28:30 pm
I am wondering how to animate the action of an NES avatar shooting a rope, horizontally and vertically. Like Spider-Man and Batman, the idea would be for the rope to emanate from the player sprite and "travel" through space to some target or max distance, then pull the player to the target. Essentially, a rudimentary grappling hook that could travel potentially the length of the screen.

My initial thought is to simply draw a series of "rope" sprites that spawn one after another until a wall, ceiling or other obstacle is detected. But this would almost certainly cause flickering in the horizontal direction. That's not a deal-breaker, but I am wondering if there's a better way.

In Battletoads level 2, there is an elegant vertical rope mechanic that is as if tethered above the screen while allowing the player to swing from side to side. In Rygar, there are multiple instances where static ropes are spawned, vertically and diagonally. I suspect the actual background tiles are changed in Rygar, due to their fixed locations in the game.

For a first pass, I would be happy to have strictly vertical and strictly horizontal ropes. Are sprites my best bet?
Title: Re: NES: Animate a horizontal or vertical rope
Post by: Cyneprepou4uk on June 20, 2021, 07:33:27 am
Keep drawing a rope till it hits something is a normal idea. If you need to limit used sprites for this, always draw 4 sprites of rope for example, and the longer it gets, the bigger distance is between them, some kind of stretching. Also you can try to cover those holes by repeatedly replacing holes with ropes and backwards, making it look almost like a complete rope.

Yes, you need to use sprites for this. If you want to use bg, you have to prepare unique tiles with rope, which will take a lot of tiles in total. And don't forget about NES color limit.

If you want to find out what does Rygar use for ropes, disable bg or spr rendering in emulator.
Title: Re: NES: Animate a horizontal or vertical rope
Post by: nesrocks on June 20, 2021, 07:36:51 pm
There's a demo someone made of gradius 2's laser weapon using bg graphics and raster effects. It only works because the laser moves at 8px per frame in his demo or something. I'm sorry I can't remember who made it, but he posted it on twitter a few months ago. I think he was japanese. Very nice stuff, but may be impractical to use in a real game.

edit: here
Title: Re: NES: Animate a horizontal or vertical rope
Post by: PolishedTurd on June 22, 2021, 07:45:48 pm
Wow, that looks really nice for the NES. That would be enough horizontal speed for my needs, but I probably do not have the chops to figure out how to do it, especially if it has only recently been discovered.

Cyneprepou4uk, that's a good idea to deliberately "flicker" the sprites myself in an animation. I'll plan on that approach.