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

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 พ.ย. 2024

ความคิดเห็น • 71

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

    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 2 ปีที่แล้ว

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

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

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

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

    "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 2 ปีที่แล้ว +27

    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.

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

      Interesting!

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

      Érdekes.

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

      wow... clever!

  • @noah4ever503
    @noah4ever503 2 ปีที่แล้ว +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!

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

    This guy inspired me to get started with game development

  • @Ant-iy7jt
    @Ant-iy7jt 2 ปีที่แล้ว

    Sick man! I love your improvements to this game.

  • @spekkio3864
    @spekkio3864 2 ปีที่แล้ว

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

  • @yeppiidev
    @yeppiidev 2 ปีที่แล้ว +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 (?)

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

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

  • @leonklingele
    @leonklingele 2 ปีที่แล้ว

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

  • @FakeItemBoxLetsPlays
    @FakeItemBoxLetsPlays 2 ปีที่แล้ว

    You make this with just code. Amazing.

  • @netfri25
    @netfri25 2 ปีที่แล้ว +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

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

    TH-cam 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  2 ปีที่แล้ว +2

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

  • @netfri25
    @netfri25 2 ปีที่แล้ว +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

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

    Underrated bro

  • @growwithanshuman
    @growwithanshuman 2 ปีที่แล้ว

    That was awesome keep it man , love c++

  • @refeals
    @refeals 2 ปีที่แล้ว

    Nice! Been waiting for this video!

  • @sky_beast5129
    @sky_beast5129 2 ปีที่แล้ว +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  2 ปีที่แล้ว +1

      Why is that?

    • @sky_beast5129
      @sky_beast5129 2 ปีที่แล้ว +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

  • @NikolasDanielEngels
    @NikolasDanielEngels 2 ปีที่แล้ว

    Very good! Happy new year!!!

  • @Dorbellprod
    @Dorbellprod 2 ปีที่แล้ว

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

  • @puppergump4117
    @puppergump4117 2 ปีที่แล้ว +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

  • @haizk
    @haizk 2 ปีที่แล้ว

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

  • @MrLedezmaa
    @MrLedezmaa 2 ปีที่แล้ว

    Can you make an akinator using sfml?

  • @leonidsamoshenko4155
    @leonidsamoshenko4155 2 ปีที่แล้ว

    can you make your own version of hearthstone?

  • @vita6580
    @vita6580 2 ปีที่แล้ว

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

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

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

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

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

  • @felusion6290
    @felusion6290 2 ปีที่แล้ว

    very cool 👍

  • @pjmclenon
    @pjmclenon 2 หลายเดือนก่อน

    how do you fire? it doesnt fire im on win 10

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

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

    • @Kofybrek
      @Kofybrek  2 ปีที่แล้ว

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

    • @glowiak3430
      @glowiak3430 2 ปีที่แล้ว

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

  • @bioman1hazard607
    @bioman1hazard607 2 ปีที่แล้ว

    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  2 ปีที่แล้ว +1

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

  • @creative1978
    @creative1978 2 ปีที่แล้ว

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

  • @imashnik6661
    @imashnik6661 2 ปีที่แล้ว

    When are you going to do the Galaga video?

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

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

  • @dtalaverin889
    @dtalaverin889 2 ปีที่แล้ว

    Finally

  • @sezy-c9201
    @sezy-c9201 2 ปีที่แล้ว

    what is the application of sprites?

    • @Kofybrek
      @Kofybrek  2 ปีที่แล้ว

      Aseprite.

  • @logik6414
    @logik6414 2 ปีที่แล้ว

    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

  • @Aisbejsijdns
    @Aisbejsijdns 2 ปีที่แล้ว

    What program do you use to draw images?

    • @Kofybrek
      @Kofybrek  2 ปีที่แล้ว

      Aseprite.

    • @Aisbejsijdns
      @Aisbejsijdns 2 ปีที่แล้ว

      ​@@Kofybrek but is it free?

    • @Kofybrek
      @Kofybrek  2 ปีที่แล้ว

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

  • @pjmclenon
    @pjmclenon 2 หลายเดือนก่อน

    hello the spaceship doesnt fire it only moves

    • @pjmclenon
      @pjmclenon 2 หลายเดือนก่อน

      Z key fires and thee is no auios it scomples to add the rquired files anc code

  • @atimoca5758
    @atimoca5758 2 ปีที่แล้ว

    11:55 Why not?

  • @ninebysixteen222
    @ninebysixteen222 2 ปีที่แล้ว

    how much time one game take to make?

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

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

    • @ninebysixteen222
      @ninebysixteen222 2 ปีที่แล้ว

      @@Kofybrek op brother❤️

  • @Niro_MC
    @Niro_MC 2 ปีที่แล้ว

    Me watch start now

  • @tekkvega
    @tekkvega 2 ปีที่แล้ว

    guh-loga

  • @rizwanafarween7371
    @rizwanafarween7371 2 ปีที่แล้ว

    Bro can you please show the full code

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

      The link to the Github repo is in the description.

  • @syedfaizan5893
    @syedfaizan5893 2 ปีที่แล้ว

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

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

      It's in the description.

  • @honghanh_honghanh_
    @honghanh_honghanh_ 2 ปีที่แล้ว

    i was play that thing

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

    first