Making SPACE INVADERS in C++ - SFML Gamedev - Devlog

Sdílet
Vložit
  • čas přidán 29. 12. 2021
  • I tried to remake (and improve) the original Space Invaders game using C++ and SFML.
    Discord: / discord
    Github: github.com/Kofybrek
    Itch io: kofybrek.itch.io
    Patreon: / kofybrek
    Subreddit: / kofybrek
    Twitter: / kofybrek
    Code: github.com/Kofybrek/Space-inv...
    #code #coding #programming

Komentáře • 68

  • @Kofybrek
    @Kofybrek  Před 2 lety +25

    This is the last video of this year! And it's the longest video I've ever made on this channel! I sacrificed my sleep just so I could publish it before 2022. So please, if you enjoyed the video, hit the like button and subscribe for more content like this!
    Also, consider supporting this channel on Patreon for exclusive content as well as early access to future videos and projects: www.patreon.com/Kofybrek
    P.S. I just realized that I forgot to add destructible obstacles above the player. Ugh! I hate myself!

    • @yeppiidev
      @yeppiidev Před 2 lety

      Unfortunately I can't donate but I'm indeed subscribed!

    • @Logicatube
      @Logicatube Před 2 lety +1

      ладно, с новым годом! удачи тебе)
      ----
      okay happy new year! good luck to you)

  • @OrangeDied
    @OrangeDied Před 2 lety +43

    "We can fix this problem by deleting the project" is what I think at 3AM when my messy code has made everything horrible to work on and fix

  • @akoskormendi9711
    @akoskormendi9711 Před 2 lety +26

    Fun fact: in the original game the enemies weren't planned to move faster as you killed them, but because there was less calculation to do with less enemies, the computer started calculating their movement faster. But it worked really well, so it was left in as a feature.

  • @noah4ever503
    @noah4ever503 Před 2 lety +14

    Great video! Dont stop making videos. The quality is sooo good and they are so much fun to watch. You derserve a lot more subscribers!

  • @Ant-iy7jt
    @Ant-iy7jt Před 2 lety

    Sick man! I love your improvements to this game.

  • @NikolasDanielEngels
    @NikolasDanielEngels Před 2 lety

    Very good! Happy new year!!!

  • @mikael808
    @mikael808 Před 2 lety +5

    CZcams recommended this to me! This channel really is a hidden gem!! I'm currently learning sfml and c++ myself. One question: for how long have you been programming or learning c++ and sfml? I'm wondering because I'm learning it myself. Thanks! And subscribed! :)

    • @Kofybrek
      @Kofybrek  Před 2 lety +2

      Glad you liked it! I've been learning C++ for 3 years I think.

  • @leonklingele
    @leonklingele Před 2 lety

    It feels amazing to be a part of your video! ❤️

  • @diwakar_tsn
    @diwakar_tsn Před 11 měsíci

    This guy inspired me to get started with game development

  • @k1ng_frnk519
    @k1ng_frnk519 Před 2 lety +1

    your videos are so entertaining i had to be early when it came out

  • @yeppiidev
    @yeppiidev Před 2 lety +3

    Was waiting for this video, and now it's finally out! BTW you should also do a video where you use RayLib to make a 3D platformer game (?)

  • @netfri25
    @netfri25 Před 2 lety +2

    i think its better to always just check the first element in the vector of bullets to see if its out of bounds, and if so then remove it.
    this way you dont have to check the entire vector each time

  • @growwithanshuman
    @growwithanshuman Před 2 lety

    That was awesome keep it man , love c++

  • @refeals
    @refeals Před 2 lety

    Nice! Been waiting for this video!

  • @spekkio3864
    @spekkio3864 Před 2 lety

    When you speak, I think to Gary from Final space.
    Your videos are awesome! Thanks a lot for your work

  • @FakeItemBoxLetsPlays
    @FakeItemBoxLetsPlays Před 2 lety

    You make this with just code. Amazing.

  • @netfri25
    @netfri25 Před 2 lety +2

    Have you heard of enums? its a useful feature, for example you can use an enum for the enemy type instead of unsigned char.
    It makes the code more readable

  • @WinterNox
    @WinterNox Před 2 lety +1

    Underrated bro

  • @Dorbellprod
    @Dorbellprod Před 2 lety

    That moment when the project gets to "Make It Pretty" 🤩🤩🤩

  • @felusion6290
    @felusion6290 Před 2 lety

    very cool 👍

  • @sky_beast5129
    @sky_beast5129 Před 2 lety +1

    4:30 Instead of asking yourself whether or not youre committing an unforgiable sin, I would call that return by value function an unforgivable sin.
    Always return by reference if possible.

    • @Kofybrek
      @Kofybrek  Před 2 lety +1

      Why is that?

    • @sky_beast5129
      @sky_beast5129 Před 2 lety +2

      @@Kofybrek You basically avoid unnecessary copying.
      In C++ you can either return by value or by reference. If you want to return by reference, you use the & symbol as you showed in the video. Otherwise your function will always return by value.
      The difference between return by value and return by reference is that return by value returns a copy of your actual data and return by reference returns the actual data itself without any additional copying.
      Let's say you have these functions:
      std::string GetName() { return m_Name; }
      std::string& GetName() { return m_Name; }
      Both functions simply return the m_Name variable, however the first function returns by value and the second one returns by reference.
      The first one will actually allocate additional memory to make a copy of the m_Name string and then return this copy.
      The second function will return the actual m_Name variable, hence allowing you to modify (or not if you don't need to) that data without any extra memory allocations.
      Imagine you have a vector with 1000 of elements. If you want to modify the actual vector outside of the class that owns it, you HAVE TO return by reference, because modifying a copy doesn't change the original data, obviously.
      But even if you just want to read the data, you should return by reference to avoid unnecessary copying/memory allocations.
      The reason for that is that these unnecessary memory allocations will have an impact on your performance. Obviously the code in this video would not suffer from return by value functions, because your program is very small. However, it is good coding practice to remember to return by reference if possible.
      I hope I made this a bit more clear now to you :D

  • @puppergump4117
    @puppergump4117 Před 2 lety +1

    I think it'd be better if you went into more detail about the less commonly known things, like how you drew animations or why you used std::clamp (I've never seen anyone else use it). But I'm dumb so maybe not

  • @dtalaverin889
    @dtalaverin889 Před 2 lety

    Finally

  • @haizk
    @haizk Před 2 lety

    can i use this for reference. i have school project
    thanks

  • @bioman1hazard607
    @bioman1hazard607 Před 2 lety

    You forgot the barriers that protect the player and injure the aliens, in the ps1 game you could move them up when you hit them and after a bunch of hits they blow up

    • @Kofybrek
      @Kofybrek  Před 2 lety +1

      Yeah, I realized that while I was editing the video.

  • @creative1978
    @creative1978 Před rokem

    Please make a video to configure sfml on visual studio and use Cmake file on VS. Very thanks!!!!

  • @leonidsamoshenko4155
    @leonidsamoshenko4155 Před 2 lety

    can you make your own version of hearthstone?

  • @Niro_MC
    @Niro_MC Před 2 lety

    Me watch start now

  • @vita6580
    @vita6580 Před 2 lety

    but could you also still do galaga tho....

  • @MrLedezmaa
    @MrLedezmaa Před rokem

    Can you make an akinator using sfml?

  • @logik6414
    @logik6414 Před 2 lety

    I have always been interested with coding but never done anything because I cba to code
    But I am very good with coding logic gates in scrap mechanic.
    One thing I have made was the no internet game with TERRIBLE graphics because I cba lol

  • @bilalchabiene5849
    @bilalchabiene5849 Před 10 měsíci

    Hi, @Kofybrek, can you make an Angry Birds clone using C++, SFML and Box2D?

    • @Kofybrek
      @Kofybrek  Před 10 měsíci +1

      I never worked with Box2D but I'm interested in learning it. I'll definitely do it!

  • @glowiak3430
    @glowiak3430 Před rokem +1

    May I ask, why do you use chars instead of integers and why are all the variables unsigned?

    • @Kofybrek
      @Kofybrek  Před rokem

      char variables takes less memory than int variables. I make them unsigned because I don't need them to be negative.

    • @glowiak3430
      @glowiak3430 Před rokem

      @@Kofybrek Ah, in Java I don't worry about these things...
      Also, where did you learn sfml?

  • @imashnik6661
    @imashnik6661 Před 2 lety

    When are you going to do the Galaga video?

    • @Kofybrek
      @Kofybrek  Před 2 lety +1

      I don't know. Most people wanna see something else.

  • @honghanh_honghanh_
    @honghanh_honghanh_ Před 2 lety

    i was play that thing

  • @Aisbejsijdns
    @Aisbejsijdns Před 2 lety

    What program do you use to draw images?

    • @Kofybrek
      @Kofybrek  Před 2 lety

      Aseprite.

    • @Aisbejsijdns
      @Aisbejsijdns Před 2 lety

      ​@@Kofybrek but is it free?

    • @Kofybrek
      @Kofybrek  Před 2 lety

      @@Aisbejsijdns Yes and no. You can buy it or you can compile the source code for free.

  • @tekkvega
    @tekkvega Před 2 lety

    guh-loga

  • @sezy-c9201
    @sezy-c9201 Před 2 lety

    what is the application of sprites?

  • @slightlywetbaby830
    @slightlywetbaby830 Před 2 lety +1

    Wonderful video!
    Please, for the love of pixels, don't make lemmings!

  • @ninebysixteen222
    @ninebysixteen222 Před 2 lety

    how much time one game take to make?

    • @Kofybrek
      @Kofybrek  Před 2 lety +1

      It depends on the complexity of the game. Usually 1 week (if I don't procrastinate).

    • @ninebysixteen222
      @ninebysixteen222 Před 2 lety

      @@Kofybrek op brother❤️

  • @qxb348
    @qxb348 Před 2 lety +1

    first

  • @atimoca5758
    @atimoca5758 Před 2 lety

    11:55 Why not?

  • @syedfaizan5893
    @syedfaizan5893 Před 2 lety

    Great video bro. could you share the cpp file of this code.

    • @Kofybrek
      @Kofybrek  Před 2 lety +1

      It's in the description.

  • @rizwanafarween7371
    @rizwanafarween7371 Před rokem

    Bro can you please show the full code

    • @Kofybrek
      @Kofybrek  Před rokem +1

      The link to the Github repo is in the description.