Language…
13 users online:  Atari2.0, DanMario24YT, eltiolavara9, h.carrell, Isikoro, masl, Maw, MorrieTheMagpie, Red2010, Serena, Shomi, sparksplit-smw, steelsburg - Guests: 286 - Bots: 307
Users: 64,795 (2,375 active)
Latest user: mathew

SNAKE

  • Pages:
  • 1
  • 2
For this C3 I had planned to have a couple more screenshots of my hack ready, but progress has been almost zero for the past couple months so whatever I showed off last C3 is actually still recent. Instead, I decided to put together an idea I had a while or two ago: program Snake in SMW. (I realize this has been done before using code injection in TAS's, but those are kind of different circumstances.)

The rules are simple: collect money, don't touch the edges, don't eat yourself. (same advice as in real life, really.) Use the arrow keys to move around, aim for the coins and see how long you can get!




All this is is a custom sprite (or two, technically), pretty much written from scratch but using leod's snake blocks as a reference. It's been a nice ASM exercise (after also having programmed snake in JavaScript a while ago) because using SMW as a base came with some interesting problems to overcome:

  • how do you make sure the snake only changes direction when it's aligned with the grid, while allowing for input at all times? (my solution: a RAM address to temporarily store the next direction)
  • how do you make the block-eating "tail" follow the same path as the "head"? (my solution: a buffer that holds a history of all the directions taken, with the tail reading from a certain spot in that buffer depending on the snake's current length)
  • how do you check if the head touches another part of the snake but don't count the block that's currently being spawned? (my solution: look ahead one tile depending on the current direction)


Another thing I'm wondering is... would this hack even be allowed in the Hacks section? It is a full game alright and it took a reasonable amount of effort, but with so little actual content I wonder if it'd be more accurately treated like a custom sprite showcase. (plus there's no win state.) I have no preference or strong desire to submit it either way, so I'll leave this one for the mods to decide.

In the meantime, if you'd like to indulge in hours upon hours of incredibly varied and exciting gameplay, here you go:

Download (+source)


Yep, the source is included as well. It's basically just two sprites - put them right on top of another, place a coin near them, and let the fun begin. I'm not sure how useful they'll be for the public (they're also hardcoded to stay in the lower half of screen 0 and kill you otherwise), but if there's interest and the rules allow it, I can submit them officially.

So yeah, hope you enjoy!

 


 
It would be really interesting to see what people could make and adapt from this concept of Snake inside of the SMW Engine.

I really hope we see an influx of small projects like these that can open up new ideas of hacking.

Its a short and sweet project but well done. :D
We love Snake Game, (edit the Arcade Version with 1 lives)
Everyone Loves Snake Game, Now in mario world version, it will be great
snek

I remember I saw something similar to this in an old jap hack (probably brutal mario) which was more oriented in puzzles.

Anyway this is really cool! it actually gives me a bit of nostalgia because I remember playing Snake in my old shity nokia cellphones lol
Putting this in a bonus game where you get lives based on the amount of coins you get in a certain time would be fun. Sometimes the simplest ideas are the most fun to make.
Good job!
Looks fun to kill some time just from watching the video, I should try it later. Great job with it!

Originally posted by Erik
Putting this in a bonus game where you get lives based on the amount of coins you get in a certain time would be fun. Sometimes the simplest ideas are the most fun to make.

^^^
It would be neat if Snake at the start could be longer than one, like in most Snake game implementations where your length is usually longer than one.
I didn't expect the old snake game to even be integrated into SMW at all. This is really great.
Gonna try it later, but for now, good work!
Windowless ride, feeling alive
Are you alive or just breathing?
I like how everyone's all like "snake game" and I'm all like "slither.io" for some really odd reason.

Regardless, this idea is so cool! I agree that a bonus game with this gimmick would be really cool. Don't eat yourself, or hit the walls, just eat coins to get a bonus.
Just so you know, I'm very active on the site anymore like I was before; I'm mainly on Discord now.
This could be incredibly useful as a bonus game!
Neat! Will give the code a look through later.

Originally posted by Pinci
I remember I saw something similar to this in an old jap hack (probably brutal mario) which was more oriented in puzzles.



Gooey kept sniping the post :P
HackPortsASM"Uploader"

Thanks for all the comments!

Originally posted by GlitchMr
It would be neat if Snake at the start could be longer than one, like in most Snake game implementations where your length is usually longer than one.

Feel free to tinker with the source code. #tb{:)}

Originally posted by Erik
Putting this in a bonus game where you get lives based on the amount of coins you get in a certain time would be fun.

Hm, yeah, I guess so! It'd probably need some extra code to properly end the bonus game though.

Originally posted by Sokobansolver
It's not really difficult at all until you get around 70 coins.

True - I think I managed 110 or so once.


 
About time someone turned SMW into a good, classic game.
Your layout has been removed.
I love playing Snake on a mobile phone! Now that there's something to try out by myself!
BOOYAH!!!
The Hacking of PuyoPuyo. Come join the fun, friends. 『いけいけ団長、頑張れ頑張れ団長!』
Help us raise funds for the Armed Forces of Ukraine. #ДопомагаємоРазом / #HelpTogether
“Even if you personally are so dissatisfied with life that you want the world to end, surely the cruel reality is that it will continue on, unchanging. All the better for someone perfectly content, like me.”
Aya Shameimaru, Touhou Suzunaan ~ Forbidden Scrollery
I think I did pretty well



I actually got to 218 (out of 224) before a coin spawned under the snake's head, giving me 1 coin per frame.

I used savestates
Dang pretty neat stuff wye. Is tetris coming anytime soon? :)
  • Pages:
  • 1
  • 2