I Coded Snake but there's a Catch...

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ก.ค. 2022
  • So... in my latest indie game I coded snake except that the roles get reversed.
    In this video I show off my most recent indie game Inverse Snake. It is a small game I coded where the player plays snake as the food instead of the snake. If you like this video, make sure to subscribe and leave a comment down below if you have any suggestions on what I should make next.
    LINKS
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
    Support the channel: ko-fi.com/codenoodles
    Itch.io: codenoodles.itch.io/
    GitHub: github.com/OfficialCodeNoodles
    █▀ █ █ █▄▄ █▀ █▀▀ █▀█ █ █▄▄ █▀▀
    ▄█ █▄█ █▄█ ▄█ █▄▄ █▀▄ █ █▄█ ██▄
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 2.3K

  • @CodeNoodles
    @CodeNoodles  ปีที่แล้ว +4444

    Due to popular demand the thumbnail has been changed to the proper grammar (you're instead of your). So, you're welcome! Also, thanks for the support, guys!

    • @waffler-yz3gw
      @waffler-yz3gw ปีที่แล้ว +283

      i found this video after the change and im really nitpicky so i probably would have ignored this video if the thumbnail grammar was wrong, thank you

    • @wertyjax
      @wertyjax ปีที่แล้ว +141

      I actually ignored the video because of that, now watching it

    • @irok1
      @irok1 ปีที่แล้ว +31

      Good save

    • @waffler-yz3gw
      @waffler-yz3gw ปีที่แล้ว +76

      @@wertyjax your spelling, sir.

    • @dagreatleaf9003
      @dagreatleaf9003 ปีที่แล้ว +52

      Change it to your’re

  • @ethanisnotsleeping
    @ethanisnotsleeping ปีที่แล้ว +4328

    This would make for an interesting multi-player game pitting snakes against the food
    People playing as snakes compete to become the biggest, whereas the food tries to stay alive as long as possible or kill all the snakes

    • @CodeNoodles
      @CodeNoodles  ปีที่แล้ว +515

      So many good ideas!

    • @kayagorzan
      @kayagorzan ปีที่แล้ว +141

      Like a weird battle royale I presume

    • @johnes4882
      @johnes4882 ปีที่แล้ว +257

      @@kayagorzan I assume it would be more like an .io game where there are no definite rounds and when you die you just go back to the bottom of the leaderboard

    • @JoooooooooooooooooooooooooooJ
      @JoooooooooooooooooooooooooooJ ปีที่แล้ว +11

      Reminds me of Pac-Man VS

    • @Ucatty2
      @Ucatty2 ปีที่แล้ว +7

      Snakes and Voles! 😁

  • @justinsemple7454
    @justinsemple7454 ปีที่แล้ว +9486

    Could you use Inverse Snake to make a local multiplayer VS mode Snake? One person is the food the other is the Snake.

    • @CodeNoodles
      @CodeNoodles  ปีที่แล้ว +2702

      Brilliant idea!

    • @totoisayal5045
      @totoisayal5045 ปีที่แล้ว +670

      @@CodeNoodles what if 2 people could be food and 2 people be snakes?

    • @usernametaken017
      @usernametaken017 ปีที่แล้ว +610

      @@totoisayal5045 Snakr battle royale

    • @LampNTable
      @LampNTable ปีที่แล้ว

      rcrlicu

    • @bijeshshrestha2450
      @bijeshshrestha2450 ปีที่แล้ว +373

      All people as food sounds good too, elimination battle royale

  • @peterkiss1204
    @peterkiss1204 ปีที่แล้ว +681

    It would be funny to have a "reverse" snake, where you start with a relatively long snake that shits at frequent, but random times and you have to avoid the ever growing number of permanent shitpiles. Difficulty settings could affect the length of the snake. Or this feature could be combined with the original game.

    • @umanglunia2194
      @umanglunia2194 ปีที่แล้ว +35

      Pretty easy to win I think, keep the tip of the tail at the edge :)

    • @chrisrenemans5026
      @chrisrenemans5026 ปีที่แล้ว

      @@umanglunia2194 add food which extends the snake length, and give the feces a timer. Get to small you lose, to large and you get yourself killed.

    • @justjillie6391
      @justjillie6391 ปีที่แล้ว +1

      😂

    • @dhruvgupta5658
      @dhruvgupta5658 ปีที่แล้ว +2

      Dude wtf that's perfect I'll take it

  • @purplehaze2358
    @purplehaze2358 ปีที่แล้ว +309

    I feel like this type of content is too smart for my tiny little brain.

    • @Neoh53
      @Neoh53 ปีที่แล้ว +7

      I you admit it, then that mean you have a bigger brain than you thougth

    • @placeholdername3907
      @placeholdername3907 ปีที่แล้ว +11

      The pain from learning is just your brain getting bigger

    • @Taha632RMF
      @Taha632RMF ปีที่แล้ว

      ​@@placeholdername3907No pain no gain they say

  • @Beregorn88
    @Beregorn88 ปีที่แล้ว +1470

    Here some suggestions
    Gives the snakes different colours and a different shade for the head
    Make the snakes always target the nearest piece of food, so that you can trick a snake into another piece of food, rather than following you, or start hunting you if you pass too close
    Snakes increase their speed every time they eat a piece of food

    • @donuthurtmyhoney8313
      @donuthurtmyhoney8313 ปีที่แล้ว +103

      I suggest a speed cap, if the bottom suggestion is added

    • @ryleygriggs9840
      @ryleygriggs9840 ปีที่แล้ว +115

      You could also give certain snakes different behaviors. Ex. One snake goes after the closest piece of food it sees, and will not stop chasing until they disappear. One snake always chases the player but has the slowest speed of the snakes. Another snake could puppy guard an area and chases any food that's close to it radius.

    • @Kukilet
      @Kukilet ปีที่แล้ว +25

      This would be cool, like ghost in pacman

    • @mattmorgan2525
      @mattmorgan2525 ปีที่แล้ว +21

      I would also suggest a visual cue for where the player is after moving through a portal. Like a growing/blinking, fading ring centred on the player's new location.

    • @dylanzlol7293
      @dylanzlol7293 ปีที่แล้ว

      @@ryleygriggs9840 what about a snake that rather than wanting to eat you, instead simply wants to get you cornered (like imagine you're escaping from a snake and sneaky snake gets on front of you therefore you die)

  • @gabrieljreed
    @gabrieljreed ปีที่แล้ว +416

    “After picking fights with the standard library for a while”
    Pretty much sums up my coding experience lol

  • @Sollace
    @Sollace ปีที่แล้ว +156

    Oh hey, finally something I've actually done before :D
    In university I coded a snake game for fun in JS. Looking at how you did the snake, food, and collision... There are a few ways you could optimise that, definitely.
    Firstly, you don't need any collision stuff. Just have a grid that is either occupied by food, a snake segment, or air, and then when the snake moves you check the tile it's going into for whether that's A) food, or B) snake.
    If it's food, you increase the snake's length. If it's snake, the snake dies and it's game over.
    For moving the snake, you don't have to move all the segments forward. Just remove the last segment and put it in front.
    To increase the snake's length when eating food, do the same as above without removing the tail segment.

    • @waldoman7
      @waldoman7 ปีที่แล้ว +1

      So why don't you need collision prevention

    • @Sollace
      @Sollace ปีที่แล้ว +1

      @@waldoman7 I already explained why,

    • @bramvanduijn8086
      @bramvanduijn8086 ปีที่แล้ว +4

      That's quite elegant.

    • @bramvanduijn8086
      @bramvanduijn8086 ปีที่แล้ว +12

      @@waldoman7 Because you're not building a physics engine, just applying some very basic boolean logic.

    • @Seedx
      @Seedx ปีที่แล้ว +4

      I made one in JS too! I didn’t even think about moving the last segment to the front though 😂 that’s a much better solution

  • @weirdnessfades
    @weirdnessfades ปีที่แล้ว +55

    To the people who can code... I salute to you

  • @keny1000
    @keny1000 ปีที่แล้ว +1447

    You should've given each snake a different color so when they're all in a clump you can still differentiate them

    • @VortXMusic
      @VortXMusic ปีที่แล้ว +26

      Pacman

    • @testerwulf3357
      @testerwulf3357 ปีที่แล้ว +96

      @@VortXMusic enemies being colored doesn't mean it's pacman

    • @noname48293
      @noname48293 ปีที่แล้ว +16

      Tetris

    • @Wm7forthewin
      @Wm7forthewin ปีที่แล้ว +14

      @@testerwulf3357 Legend Of Zelda

    • @ismaelsantos5378
      @ismaelsantos5378 ปีที่แล้ว +12

      @@Wm7forthewin King's Quest

  • @the_loose_goose
    @the_loose_goose ปีที่แล้ว +169

    3:21 I think your heart rate monitor is broken

    • @trethetree
      @trethetree ปีที่แล้ว +4

      Lol

    • @leandroTRA
      @leandroTRA ปีที่แล้ว +5

      "When your wife says your in laws are comigo over

    • @thomicfee529
      @thomicfee529 ปีที่แล้ว +8

      “Yo nurse get on this i got a highscore”

  • @gooseharbinger4851
    @gooseharbinger4851 ปีที่แล้ว +50

    3 things:
    1. You should hace a portal respawn cooldown when you go through the portal to discourage camping the portals and going through last second.
    2. What happens if you go through the food?
    3. If you want to make sure the snakes dont go straight for you you should make it so that they redirect to the closest food every 2ish seconds.
    Obviously i dont expect you to add these (ive taken some coding classes and i hate going back to a finished product and changing my code) but it is some solutions/questions i thought of when i was watching

    • @NightChime
      @NightChime ปีที่แล้ว

      Imagine if you could eat the food, too, and get longer, increasing your length, making it harder to dodge enemies. Extra hazard of lesser importance, but enough to be worth avoiding when possible.

  • @NLR-J
    @NLR-J ปีที่แล้ว +12

    Here's a good idea for the game: make it, so that if a snake dies, it responds as only the head. This makes it so it's impossible for the snakes to all kill themselves, leaving you with an open field with no enemies. This will make the game more infinite.

    • @Profeshinal
      @Profeshinal ปีที่แล้ว

      He could add an endless mode using this idea

  • @larsthememelord3383
    @larsthememelord3383 ปีที่แล้ว +384

    maybe a cool thing could be that the snakes prefer walking in straight lines like a player would do in snake only sometimes going diagonal

    • @ChasmChaos
      @ChasmChaos ปีที่แล้ว +13

      Yeah, that diagonal walk was so weird. A real uncanny valley experience.
      There could be a cost associated with the choice of movement. A string up North-South + East-West movements would have a much larger cost vs a string of only North-South or East-West movements.

    • @luisd.mancilla8169
      @luisd.mancilla8169 ปีที่แล้ว +8

      I thought the same thing. Maybe tie it to the difficulty? Have the snakes move only in straight lines on easy difficulty, occasionally diagonally on normal, and always take the most efficient route on hard

    • @Seedx
      @Seedx ปีที่แล้ว

      I made that in my program, there’s 2 snake AIs: one that chases you diagonally and one that goes parallel to you but only spawns 15% of the time

  • @commanderdemonno9819
    @commanderdemonno9819 ปีที่แล้ว +974

    so; here's an idea
    give snakes their own """"personalities"""", like in pacman where the ghosts have different behavior
    one might be persistent on chasing you, while one might try and wall you off once it realizes you're moving
    also, another thing you might want to add: some way to deter or even flat out kill one of the snakes temporarily, perhaps a poison apple you have to bait the snake into?

    • @Techy404
      @Techy404 ปีที่แล้ว +62

      Next, we give them names like the ghosts

    • @alinac.7919
      @alinac.7919 ปีที่แล้ว +19

      @@Techy404 meh, but them it’s basically pacman

    • @Techy404
      @Techy404 ปีที่แล้ว +44

      @@alinac.7919 it was a joke but yeah true, although the main diference would be that there is no maze

    • @alinac.7919
      @alinac.7919 ปีที่แล้ว +2

      @@Techy404 true true

    • @TheGamingLegendsOfficial
      @TheGamingLegendsOfficial ปีที่แล้ว +33

      @@Techy404 you're wrong - the snakes ARE the maze >:D

  • @Sly-Moose
    @Sly-Moose ปีที่แล้ว +39

    Dude made a whole new game. Mad respect. Interesting concept.

  • @memetech-
    @memetech- ปีที่แล้ว +2

    Note to self: make clone of this and make the player only move the first frame you press the button but you move every time you start pressing so if you want to really run away you have to really MASH

  • @primozuado
    @primozuado ปีที่แล้ว +2145

    got a feeling this is gonna blow up real soon. Great display of content in coding and game creation.

    • @yaslerfuj
      @yaslerfuj ปีที่แล้ว +22

      Same, I thought this was a viral coding video or something, but just a random suggestion, hope it blows up :)

    • @DaemonWorx
      @DaemonWorx ปีที่แล้ว +9

      Here before 300 subs lol. But I do feel the same

    • @tt_thoma
      @tt_thoma ปีที่แล้ว +2

      I forgor to subscribe but you reminded me

    • @cherpsy3770
      @cherpsy3770 ปีที่แล้ว +1

      yea

    • @seyj7457
      @seyj7457 ปีที่แล้ว +11

      It blew up. TH-cam recommended it to me and the only reasonable connection is one Code Bullet video I skimmed through a couple weeks ago

  • @castlehaha
    @castlehaha ปีที่แล้ว +2

    This is so underrated, I am definitely subbed

  • @simplistic9899
    @simplistic9899 ปีที่แล้ว +5

    POV: you visit your grandma in the hospital
    the heart monitor: 3:30

  • @feffy380
    @feffy380 ปีที่แล้ว +2247

    "It's not an AI"
    Yes it is. Though hand-coded, it makes intelligent decisions based on its environment. You find these kinds of search algorithms at the start of every intro to AI course. Machine learning isn't the only subfield of AI

    • @Rutious4
      @Rutious4 ปีที่แล้ว +156

      Yes thank you it annoys me so much

    • @ManiGzz87
      @ManiGzz87 ปีที่แล้ว +49

      Still technically not AI.

    • @MrDarkSky
      @MrDarkSky ปีที่แล้ว +124

      I like your funny words, magic man

    • @bravebeatT
      @bravebeatT ปีที่แล้ว +150

      @@ManiGzz87 its a fkin AI bcz it makes DESICIONS between 2 or more status

    • @ManiGzz87
      @ManiGzz87 ปีที่แล้ว +22

      @@bravebeatT Still TECHNICALLY not an AI

  • @4P5MC
    @4P5MC ปีที่แล้ว +595

    This is very good quality for such a small channel! One suggestion I'd have is give the snakes a random offset from their base colour. Not enough to make them wildly different, but just enough that you can tell two of them apart when they're adjacent.

    • @CodeNoodles
      @CodeNoodles  ปีที่แล้ว +99

      Excellent point! This isn't actually my first time doing crazy things with snake because one time I did exactly what your describing. Thanks for the support!

  • @whyyoutry2021_YT
    @whyyoutry2021_YT ปีที่แล้ว +2

    That is impressive when it's been years since anyone played snake a very long time and came back with you coding being Food instead of snake that is impressive

  • @E5PY
    @E5PY ปีที่แล้ว +3

    I am just beginning my python journey. I initially didn't understand how making games would apply to real life tasks but your video helped me connect those dots. Thank you so much for including some of the work for the game.

  • @KateSullivan135
    @KateSullivan135 ปีที่แล้ว +180

    I have a few suggestions for making the game more interesting. Have the score be based on how many fruits you can collect yourself. Collecting fruits give you some amount of score, and that score has a bonus for each fruit you've gotten without using a portal. If you take a fruit that a snake was after, it aggros you. Using a portal resets your multiplier, but it also resets the aggro on any snakes that had you targeted. This gives you an objective that intersects with the snakes objective, and instead of standing next to a portal and waiting on snakes to get close, you are constantly moving into danger.

    • @Lavanence
      @Lavanence ปีที่แล้ว

      snake pacman

  • @lomanalchemik7749
    @lomanalchemik7749 ปีที่แล้ว +287

    I really love it!
    Few tips for actual game:
    1. You should make snakes different colours so they don't blend together
    2. You could add some massive point boost after killing the snake so it would be more profitable to outsurvive them all in a short game than to simply survive the longest time possible.
    And for 2.0:
    Powerups. Players love powerups let it be brief invulnerability, repelent, bonus points, speed up, slow for snakes, freeze time, even extra life!

    • @MakingYouSad
      @MakingYouSad ปีที่แล้ว +8

      Cool suggestions, I hope we will something like this implemented in the game :)

    • @mamathama8923
      @mamathama8923 ปีที่แล้ว

      You can add them yourself. The source code is available.

    • @zaishijunior9455
      @zaishijunior9455 ปีที่แล้ว

      @@mamathama8923 hara hara hara ha ha harararararara

  • @SpaceLobster21
    @SpaceLobster21 ปีที่แล้ว +3

    I think it'd be pretty cool if going through a portal caused any snakes currently chasing you to re-assess which piece of food they're chasing (randomly select a piece of food again, there's a chance they'll still be chasing you). This gives the player a chance to properly escape from the snakes.
    Pretty cool project!

  • @thatoneyoutuber777
    @thatoneyoutuber777 ปีที่แล้ว +4

    Love the music! And the game looks really good, the UI and all the art blends well together 👍🏼👏🏼

  • @stupidAgeverificatio
    @stupidAgeverificatio ปีที่แล้ว +53

    I would probably rotate one set of portals 45 degrees for easier identification and have each food a different color and have the head of the snake match the color of the food it's navigating to.

  • @azarious644
    @azarious644 ปีที่แล้ว +108

    This actually seems terrifying in the fruits pov. Imagine an entire zoo's worth of snakes getting bigger with each of your brethren they eat and when they see you they relentlessly chase after you until you're eaten
    3:13 also anime moment

    • @Blue-fg8vt
      @Blue-fg8vt ปีที่แล้ว +4

      I imagine due to being a different color, your a mouse not a fruit.

  • @emilyb5307
    @emilyb5307 ปีที่แล้ว +1

    I know almost nothing about coding, but this is fascinating... I appreciate that I could still follow things too. Thanks for sharing your work. It's a good reminder of how complex creations that seem deceptively simple can be. Impressive!

  • @5000Famous
    @5000Famous ปีที่แล้ว +1

    So apparently this video super blew up and you went up from maybe 500 subscribers to over 10 thousand? That's impressive, I personally can't wait to see if this gets a V2. You have my sub.

  • @Vorael
    @Vorael ปีที่แล้ว +39

    This is neat! I think it'd be cool if you gave the snakes the Pac Man ghost treatment, honestly. Give them different colors and different "personalities." One could always be hunting you regardless, one could more or less ignore you and only go after stationary food, one could just go after whatever food was closest, one could randomly switch targets every few seconds, etc.

  • @lemonlordminecraft
    @lemonlordminecraft ปีที่แล้ว +14

    I love this idea. It’s such a simple to grasp gamemode with quite a nice layering of that paradoxical meta that “primitive” games like this are known for. “Aim is to avoid the snakes but if all snakes die you lose out on points,” is such an intrinsically satisfying predicament. I’m telling you, people would’ve gone crazy for this in the 80s and 90s.

  • @xM0nsterFr3ak
    @xM0nsterFr3ak ปีที่แล้ว +5

    1:18 made me laugh way harder than it should😂

  • @bleachisgoodforyouhealth7800
    @bleachisgoodforyouhealth7800 ปีที่แล้ว +1

    You are a very gifted teacher. I've been teacNice tutorialng soft for over 50 years and really appreciate your video being a beginner in soft soft.

  • @KStarPR
    @KStarPR ปีที่แล้ว +49

    Aside from the "controlling the food" part, this reminds me of an old pc game called Snake Arena. I've always wanted a new version of that game, and an inverse mode would be pretty cool, especially if other people's "food vs. snake" mode idea is incorporated.

  • @adamj.mc.3078
    @adamj.mc.3078 ปีที่แล้ว +89

    I killed all the snakes and the you won screen didnt pop up,
    Factors:
    - Easy mode
    - 1 Hp remaining
    - 3 final snakes all died in the same move
    Beyond that im not sure what would affect the function youre presumably using to detect this victory condition

    • @piegames-em2sv
      @piegames-em2sv ปีที่แล้ว +2

      *you're

    • @adamj.mc.3078
      @adamj.mc.3078 ปีที่แล้ว +5

      @@piegames-em2sv thanks for letting me know I missed a single '

  • @goldenruby4
    @goldenruby4 ปีที่แล้ว

    Knowing how to code could be the most impressive and amazing things ever

  • @That1Knife
    @That1Knife ปีที่แล้ว +1

    I love this! Another idea: make the "AI" track the nearest food instead. Then if you go too close to the snake it will go after you, but if you go close to a piece of food the snake might get temporarily distracted and go get the food before going back to get whatever food is closest from there.

  • @rcnhsuailsnyfiue2
    @rcnhsuailsnyfiue2 ปีที่แล้ว +50

    Your code is super clean! 💯 Structured logically, formatted nicely, and easy to follow. Having managed dev teams for many years, my code review senses got all excited watching this… 😆 Great vid!

    • @CodeNoodles
      @CodeNoodles  ปีที่แล้ว +14

      Lol thanks! Most people are quick to point out problems/flaws with code so thanks for the positive feedback!

    • @rcnhsuailsnyfiue2
      @rcnhsuailsnyfiue2 ปีที่แล้ว +7

      @@CodeNoodles and well deserved! It’s rare to see code of this standard on TH-cam... I really appreciated your consistent naming conventions (“isX()” for functions returning booleans, or “getX()” for methods returning calculated properties). Your static Snake::isSafe() method used reference calling cleverly across multiple Snake instances… And I liked how you used ternary operators to make your code shorter, but not at the expense of readability :)
      I’m guessing you do this professionally? If you don’t mind me asking, for how many years? Keep it up dude. Your code is poetry 🙌🏻

    • @gurvanshsingh2271
      @gurvanshsingh2271 ปีที่แล้ว +3

      @@CodeNoodles the reason they can even POINT out flaws is cuz you code is clean as hell
      Wear it as a badge of honor my g

    • @deatho0ne587
      @deatho0ne587 ปีที่แล้ว

      @@CodeNoodles 5:08
      Hate to be mean, but this fails both clean (5 indents, lines 13 to 23 should most likely be a separate function) and it sounds like you did not fully understand it (basically can you describe it to a none DEV).
      Just one example, most of it looks good and I can understand the function at 5:08 in context.

  • @Slackow
    @Slackow ปีที่แล้ว +16

    Damn I wish I could come up with ideas like this! This is really cool. I saw a lot of people suggest to make the snakes movements more natural, and I think I have an idea for that.
    Each snake calculates the distance to its target on the x and y axis and then generates a random number to see which direction it should go in, so for example if it's 3 units away in a direction and 7 in the other, it'll have a 3/10 chance of going in the first direction and a 7/10 chance of going in the other, this way the movement looks more natural.

  • @randellarrogante4329
    @randellarrogante4329 ปีที่แล้ว

    Man, you don't know how grateful I am right now! THANK YOU SO MUCH!!!

  • @brodyperry2294
    @brodyperry2294 ปีที่แล้ว

    I may not be looking in the right areas but I don’t know that I’ve ever seen someone make there game available and I love that, thank you

  • @LukeSmith1984
    @LukeSmith1984 ปีที่แล้ว +3

    I am finding an alarming number of videos with amazing quality and very little views, and this is one of them.

  • @ftwgaming0
    @ftwgaming0 ปีที่แล้ว +7

    8:19 Casually just portal into the body of a snake.

    • @CodeNoodles
      @CodeNoodles  ปีที่แล้ว +3

      Lol, um pretend you didn't see that

    • @trethetree
      @trethetree ปีที่แล้ว +1

      @@CodeNoodles see what?

  • @itsmesky3545
    @itsmesky3545 ปีที่แล้ว +1

    You do not understand the level of disgust I felt throughout this whole video watching the snakes move diagonally like that.

  • @justyournormalblitz
    @justyournormalblitz ปีที่แล้ว +1

    CodeNoodles : So how long are you gonna go on for?
    The Algorithm : Yes!

  • @goobyahh7142
    @goobyahh7142 ปีที่แล้ว +21

    I would’ve never come up with an idea like this that’s actually amazing! I wish I could be creative like that and not lazy enough to start learning code cause coding looks interesting

    • @CodeNoodles
      @CodeNoodles  ปีที่แล้ว +4

      Coding can be hard but infinitely rewarding. If you have the means to do so trust your gut and go for it. Thanks for the support!

  • @Firefly256
    @Firefly256 ปีที่แล้ว +20

    I think the portals should have a set distance, so they’re not too close to each other which makes the portals kind of useless.
    I also think screen wraps will be a great addition as well so there’s a secondary option to escape other than portals

    • @pineappleudh6561
      @pineappleudh6561 ปีที่แล้ว +1

      Problem with that is you could just stand at the edge and repeatedly go back and forth, so long as you were fast I'm pretty sure it would make you nearly immortal.

    • @proloycodes
      @proloycodes ปีที่แล้ว +2

      @@pineappleudh6561 what if the snake could screen wrap as well?

    • @pineappleudh6561
      @pineappleudh6561 ปีที่แล้ว +2

      @@proloycodes
      Would likely be even more complicated to code and would completely invalidate the usefulness of the mechanic but would fix the issues I provided. (Probably)

    • @JKd3vLD
      @JKd3vLD ปีที่แล้ว +1

      It could be done in certain areas only, much like PacMan does

    • @Firefly256
      @Firefly256 ปีที่แล้ว

      @@pineappleudh6561 maybe add a cooldown?

  • @ThyGooberTheThird
    @ThyGooberTheThird ปีที่แล้ว +1

    Mkay I am just IMPRESSED that you know how to code alllll of that in like what a week? That’s just… wow

  • @SerenityFeueropal
    @SerenityFeueropal ปีที่แล้ว +1

    5:53 and that's when he realized he was actually building pacman.

  • @Qsie
    @Qsie ปีที่แล้ว +5

    noodles: "This total abomination" 2:11
    me: this is fine! what do you mean?
    snake tail: becomes hydra
    me: oh...

  • @CATTATAT
    @CATTATAT ปีที่แล้ว +9

    THIS IS SO UNDERRATED. Love the idea of a reverse snake game.

  • @Tonicfailure
    @Tonicfailure ปีที่แล้ว

    I love how, when you finally understand c#, and see some game making video. You actually get to understand it 🙂

  • @PlayerALH
    @PlayerALH ปีที่แล้ว +1

    I only started to watch you 1 hour ago and Im already addicted.

  • @ibemper1850
    @ibemper1850 ปีที่แล้ว +6

    code at 5:12 "don't even ask me to explain any of it", dw i will explain it
    this is what i interpret of the code
    i might be wrong, this is what i think though
    lets say we want to check if a particular snake, lets say his name is gustav, is safe, i.e gustav isnt colliding with another snake
    i have the function Snake::isSafe for just that, and i pass in the arguement is snakeIndex, and right now i am passing gustav as an input to the function, so for now, gustav = snakeIndex
    now i go through each and every snake in a list of snakes, the list of snakes is called "snakes"
    now while checking through the list of snakes, i want to check if gustav collides with any of them, but remember gustav is also in that list, i dont want to check if gustav is colliding against himself, so if(gustav==current_Snake_That_We_Are_Checking_Against_In_The_List), skip over gustav
    now i make a new "imaginary" snake called currentSnake, lets call him bob, since i like making names up
    now bob is made in such a way that his position is overlapping over the snake that we are currently checking, lets say we are checking the 3rd snake on the list, bob's position is overlapping over the 3rd snake on the list
    (the ternary operator is not even needed, unecessary complication, could have just done const Snake* currentSnake = &snakes[currentSnakeIndex]; or maybe i am just dumb and there is a reason behind it, idk)
    now we will go through every body part of bob, which in the code he calls it a "segment" of a snake
    this part is kinda long to explain and i have other things to do, so i will just tell the gist of what happens
    we go through every segment of bob, and check if that body part collides with any of gustav's body part, if yes, well gustav isnt safe, since he collided with bob
    my idea to reduce the code, i think the efficiency of the code is O(m*n) since you are using a nested loop for every part of gustav and every part of bob, essentially multiplying the time, now to check for collision, just check if gustav's head (i.e the 0th segment of the list that stores gustav's segments) is colliding with any part of bob, this is because no snake can physically move their whole body to the left or right all at once, yes snakes can TURN sideways but it cant fully move sideways or upwards or downwards all at once, so there is no need to check for every part of gustav, neither can snakes go backwards
    so the new algorithm should be O(m) , m = length of bob
    good job on the game

    • @CodeNoodles
      @CodeNoodles  ปีที่แล้ว +2

      Yes. You are correct!

  • @zskull162
    @zskull162 ปีที่แล้ว +13

    If you can, I think the snakes would look nicer if the body of the snakes was slightly smaller than the head, to make it a little easier to tell orientation when they’re next to eachother.

    • @LugiDergX
      @LugiDergX ปีที่แล้ว

      Adding onto this suggestion, actual snake like body could be cool! Head is the biggest, segment behind it slightly smaller, another smaller again, then another behind it even smaller and so on.

  • @Shadbae
    @Shadbae ปีที่แล้ว +1

    wow! this was posted on my birthday lol great video you inspire me!

  • @AMan-xz7tx
    @AMan-xz7tx ปีที่แล้ว +2

    damn, only your second video and already millions of views, I hope you keep that momentum from here on out!

  • @Deretythe
    @Deretythe ปีที่แล้ว +87

    4:50 at line 4, you were always setting currentSnake to the snake at snakeIndex, which doesn't change at any point during the method. So each snake was only trying to avoid one particular snake many times, instead of trying to avoid every snake one time. If you had snakes[currentSnakeIndex] instead, it should have worked, and wouldn't need the snakeIndex parameter at all (I'm guessing that's the index of the snake the method is called on?)

    • @Smooth_Brain
      @Smooth_Brain ปีที่แล้ว +7

      and also the perpendicularity of the bisector was interfering with the vortex

    • @HiddenBush64
      @HiddenBush64 ปีที่แล้ว +2

      @@Smooth_Brainskeppy moment not really funny

    • @Smooth_Brain
      @Smooth_Brain ปีที่แล้ว

      @@HiddenBush64 how did u know

    • @HiddenBush64
      @HiddenBush64 ปีที่แล้ว +1

      @@Smooth_Brain I could recognise that phrase ‘perpendicularity of the bisector’ from a light year away

    • @mudkippity
      @mudkippity ปีที่แล้ว

      @@HiddenBush64 perpendicularity moment

  • @quentinschrader7104
    @quentinschrader7104 ปีที่แล้ว +7

    I can't even code, I'm just here cause this is cool as hell

  • @sussysugar7853
    @sussysugar7853 ปีที่แล้ว +1

    This is a really fun game concept. Super simple yet it looks very fun.

  • @nairanvac79
    @nairanvac79 ปีที่แล้ว

    I love the choice of background music for this vid.

  • @jordibuchner
    @jordibuchner ปีที่แล้ว +4

    There's a strategy you can maybe employ which is to wait for the snakes to get to a certain length and then trapping them in a self death loop before hopping into a portal and escaping being eaten. That way you're not waiting for them to make a mistake but actively killing the snakes.

  • @trbz_8745
    @trbz_8745 ปีที่แล้ว +7

    It would be interesting if the snakes gained a temporary speed boost when eating food, then slowed down. That way they can chase you faster without being perma-inescapable

  • @moonthevaporeon5113
    @moonthevaporeon5113 ปีที่แล้ว

    The experimental thing with the front and all looks amazing

  • @Incognito-rb4tz
    @Incognito-rb4tz ปีที่แล้ว +10

    :0 this is so well made! u deserve way more subs

  • @meowcat280
    @meowcat280 ปีที่แล้ว +3

    Yooo. I love this so much. I really hope to see a part two for this video. Never seen such a small channel feel so professional.

  • @romanluis8961
    @romanluis8961 ปีที่แล้ว +1

    i like that idea so i dowloaded the game. ITS AMAZING. nice job!

  • @Swaggyswisscheez
    @Swaggyswisscheez ปีที่แล้ว

    For those of you wondering out there.
    The music in the background at 0:40 is bach suite no.1 (cello)

  • @devini15yt
    @devini15yt ปีที่แล้ว +5

    This is pretty neat, I do think it would be cool if the different snakes were different colors so you could tell them apart when they go right next to each other

  • @potatomashertv4545
    @potatomashertv4545 ปีที่แล้ว +4

    youre channel is so underated

  • @pieTone
    @pieTone ปีที่แล้ว

    Coding an entire game from scratch without using a game engine is not an easy job. Well done!

  • @idontwantahandlethough
    @idontwantahandlethough ปีที่แล้ว +1

    that was a tasty code noodle bro!
    Subscribed :)

  • @boomfossil9256
    @boomfossil9256 ปีที่แล้ว +8

    Wow this is really well made content, I can feel you are gonna make it big time

  • @vladimir-gk6ml
    @vladimir-gk6ml ปีที่แล้ว +4

    This is some of the best stuff I've seen recently 😂
    Honestly tho every time you complained about programing I just died with how relatable it is

  • @juanchecaro1856
    @juanchecaro1856 ปีที่แล้ว

    Keep em' comin' and thanks for all of the help!!

  • @TJ-Henry-Yoshi
    @TJ-Henry-Yoshi ปีที่แล้ว

    I thought the thumbnail said "You are the fool" and that made this way funnier.
    Really cool concept tho!

  • @biteso2333
    @biteso2333 ปีที่แล้ว +3

    Such a weird thing that I'd never have thought of but wow that's really cool. Love what amazing stuff you did with such a seemingly simplish concept!

  • @profwoland8942
    @profwoland8942 ปีที่แล้ว +7

    This is great! You’re going to be the next CodeBullet :)

    • @lifinale
      @lifinale ปีที่แล้ว

      so he becomes non existent for a couple of months and comes back with a banger? works for me!

  • @augustaseptemberova5664
    @augustaseptemberova5664 ปีที่แล้ว +6

    Probably won't make a noticeable difference, but you can make the push 1:38 more efficient: only move the head to its next position and then push the tail segment to the position where the head was previously. Efficiency goes from O(n) -> O(1)
    This way the snake's lengths won't affect their push speed.

    • @williamdrum9899
      @williamdrum9899 ปีที่แล้ว

      Could snake size also be another variable that is kept elsewhere, kind of like a pascal string?

    • @xGOKOPx
      @xGOKOPx ปีที่แล้ว

      Or he could make tiles with snake non-walkable for the purpose of pathfinding. Seems like a sensible solution

  • @jinxedproduction
    @jinxedproduction ปีที่แล้ว +1

    He is on the way to get a lot of subs. I absolutely love all this coding stuff and I hope to see even more soon. Good luck on your TH-cam journey!

    • @CodeNoodles
      @CodeNoodles  ปีที่แล้ว +1

      Thanks so much! I've only been doing TH-cam for a bit now and already have an awesome community to encourage me! More stuff will be coming soon.

    • @jinxedproduction
      @jinxedproduction ปีที่แล้ว

      @@CodeNoodles people like you go Skyrocket! You are gonna grow your channel in no time! This coding has been popular for so long but keep getting even more!

  • @elijahwood3564
    @elijahwood3564 ปีที่แล้ว +4

    Dang that was a really good quality video I'm surprised you only have like 100 subs with videos like this you should get 1k in no time best of luck keep it up

  • @kabirbatra
    @kabirbatra ปีที่แล้ว +3

    Nice video idea and thumbnail!
    If you stick with these kind of videos, I'm sure your channel will grow quick and you'll also get better at the craft
    Good luck!

  • @Enyl_Stray
    @Enyl_Stray ปีที่แล้ว

    Looks fun ! To avoid the waiting time you could add a priority variable to make sure there's always a snake looking for you

  • @fabricioresmini1542
    @fabricioresmini1542 ปีที่แล้ว

    just imagine a 3d version of this, this can easily be a horror game where the protagonist must escape from a labirint where we have enormous snakes that want to devour him, in order to survive he use some portals and fresh meat to keep them occupied while escape

  • @IdK-ve4gu
    @IdK-ve4gu ปีที่แล้ว +3

    code bullet? no no I mean code noodles

  • @brendanr4961
    @brendanr4961 ปีที่แล้ว +3

    Awesome job! This is super inspirational for someone wanting to get into programming like me, so thanks!

  • @dodo2829
    @dodo2829 ปีที่แล้ว +1

    Congrats! Your video is on TH-cam recommendations.

  • @mikipleyer2
    @mikipleyer2 ปีที่แล้ว

    Thank you so much this helped a lot!!!! You saved my life

  • @avi99996
    @avi99996 ปีที่แล้ว +4

    Make it where the snakes slow down for a second when they eat food so you can lead them to food to give you a chance to escape

  • @paul10724
    @paul10724 ปีที่แล้ว +4

    9:16 Hey, that‘s me. 😁 Good video and an interesting idea.
    I already saw the video when it had 38 views.

    • @CodeNoodles
      @CodeNoodles  ปีที่แล้ว +2

      Thanks for the support!

    • @paul10724
      @paul10724 ปีที่แล้ว +1

      You are welcome!

  • @Koyai_Zieam
    @Koyai_Zieam ปีที่แล้ว

    As soon as I saw your channel name I am immediately subscribed because I love noodles and coding

  • @Speed001
    @Speed001 ปีที่แล้ว

    Very cool code and relatable, that's why notes are important.

  • @DS811
    @DS811 ปีที่แล้ว +3

    This seems like fun

  • @PawPaw469
    @PawPaw469 ปีที่แล้ว +5

    Snake Dance 🐍 2:42

  • @malachihormel7994
    @malachihormel7994 ปีที่แล้ว +2

    Fun concept with a simple execution, good stuff. Any time I try to make a project like this I end up with too much feature creep and abandon it.

  • @MasonAttano
    @MasonAttano ปีที่แล้ว

    ngl, I felt pretty validated when you said "this code is a mess and doesn't work. I made it work by making it even messier. Don't even ask". That's my life as a programmer lol

  • @OPTactics
    @OPTactics ปีที่แล้ว +3

    Great video and cool idea for a game. My feedback would be to replace the portal with a temporary speed buff powerup.