Code-It-Yourself! Simple Tile Based Platform Game #1

Sdílet
Vložit
  • čas přidán 3. 02. 2018
  • This video shows how to make a simple yet smooth tile-based 2D platform game, similar to classic offerings from older consoles. It uses nothing but the Windows Command Prompt to demonstrate robust collisions between the scenery and the player. All collisions are resolved using floating point truncation. No geometry.
    Shout outs to Brankec on Discord (known as GearCode elsewhere) for the request.
    Source: github.com/OneLoneCoder/Javid...
    Blog: www.onelonecoder.com
    Twitter: @javidx9
    Twitch: javidx9
    Discord: / discord
  • Věda a technologie

Komentáře • 299

  • @ethangarnier8416
    @ethangarnier8416 Před 6 lety +154

    I went from developing in C to developing in C++ because of your fun and interesting videos

    • @javidx9
      @javidx9  Před 6 lety +20

      That's great Ethan!

    • @pigeonval2736
      @pigeonval2736 Před 3 lety +4

      @@javidx9 helloooo

    • @bardiabahrampour4166
      @bardiabahrampour4166 Před 3 lety +1

      linus hates you lmao

    • @geraforever796
      @geraforever796 Před 3 lety +4

      I think c is much simpler

    • @AnnaVannieuwenhuyse
      @AnnaVannieuwenhuyse Před 3 lety +6

      @@geraforever796 It is simpler. That's because C++ also has more complicated mechanisms than C. For some of those things, C programmers like to stay with C and implement those themselves.

  • @Nikarus2370
    @Nikarus2370 Před 4 lety +36

    16:50 "not that impressive so far"
    I mean, I think its pretty damn impressive to get that much up and running with so few lines of code, and so elegantly. The olcGameEngine is pretty solid NGL. Orders of magnitude better than the engine I wrote in college to make a similar game concept for a final project where even getting this much of the game up and running would have been ~300+ lines of code (not including level design).

  • @simmonscarl1
    @simmonscarl1 Před 6 lety +5

    I really enjoy the way you explain your coding approach to solving the game scenarios. Well done.

  • @wixic111
    @wixic111 Před 6 lety +4

    I've been looking for a good answer to collision detection for a few days now and I can't believe how almost perfect this advice was for my situation, much more simple to implement and just as robust in my situation as anything like minkowski differences and anything else etc. This video was a great help! Thanks :)

    • @javidx9
      @javidx9  Před 6 lety +1

      No problem! Cheers!

  • @wailsinspace
    @wailsinspace Před 3 lety

    Your videos are what I have been looking for when it comes to tutorials. Thank you for making these!

  • @Inevitablerizzler
    @Inevitablerizzler Před 6 lety +84

    Love your videos, even if I already know these things, I like to see your way of teaching them.

    • @javidx9
      @javidx9  Před 6 lety +8

      Hey Stephan, thanks! This topic is well covered I think, but I've had a few requests to do it. It's also a nice contrast to the real collision routines in the last video.

    • @Kole-jb8yb
      @Kole-jb8yb Před 4 lety +1

      Humble braggs

  • @RogueShadowTCN
    @RogueShadowTCN Před 5 lety +12

    I did indeed forget it was the console window.
    Classy.

  • @maximgasai1349
    @maximgasai1349 Před 5 lety +11

    Using the idea of your algorithm I created more accurate way to detect collisions in my game. Thanks a lot.

  • @zal9706
    @zal9706 Před 6 lety +4

    Thanks so much for making this, even if I don’t follow along in all these videos it gives me a good idea on how things are working together in the code

    • @javidx9
      @javidx9  Před 6 lety +1

      Hi Zal, thanks I'm glad you find them useful!

  • @DavoMelendez
    @DavoMelendez Před 6 lety +64

    buddy, I want to make a public acknowledgment to your work...
    you explain briefly, clearly and extremlly good.
    I have learned a lot from C++ programming just by watching your videos.
    Best thing of all, they're fun...
    greetings from Venezuela.

    • @javidx9
      @javidx9  Před 6 lety +8

      Hey Davo, apologies for the late reply, Thanks for support, it's always pleasing to hear someone is finding the videos informative. Greetings!

    • @n.ryuudakku4916
      @n.ryuudakku4916 Před 4 lety

      mira si es un compatriota, tambien estoy aprendiendo gracias a OLC a programar en C++(vengo de C# y JAVA), me alegra ver que no soy el unico con ideas de progreso informatico en el país.
      Thanks for all Javidx9, u´r my hero man!

    • @DavoMelendez
      @DavoMelendez Před 4 lety +1

      @@n.ryuudakku4916 que tal hermano si desde hace tiempo me ha gustado el lenguaje c++ porque sirve para realizar cualquier tarea... saludos desde Maracaibo

    • @n.ryuudakku4916
      @n.ryuudakku4916 Před 4 lety

      @@DavoMelendez Eres Hermano maracaibero!, saludos desde la ciudad mas bella de este continente también para vos!

    • @paulo0651
      @paulo0651 Před 4 lety +2

      @@n.ryuudakku4916 También soy Venezolano jaja y soy de Maracaibo también jajaja. No puede ser que nos encontramos tres Maracuchos. Aunque ya no vivo allá.

  • @biosigil6164
    @biosigil6164 Před 6 lety +17

    Your videos have helped me learn C++ so quickly. Thank you for the high quality content

    • @javidx9
      @javidx9  Před 6 lety +5

      Hey thanks BioSigil - it makes it worth while when you say things like that. Good luck with your study!

  • @SWAGCOWVIDEO
    @SWAGCOWVIDEO Před 5 lety +6

    You have no idea how helpful this is! I've done so much searching online for a simple yet effective way to implement collisions in 2d platformers only to come up with solutions with mediocre results. After so many pages of sketches and code the solution was to check the corners based on where the player was moving... Awesome!

  • @iaml2909
    @iaml2909 Před 4 lety +6

    I love this channel so much.
    Bro, thanks. I have learned a lot with u videos. Love from brazil! Keep it up 💪

  • @guylianwashier4583
    @guylianwashier4583 Před 4 lety +30

    "Take that visual studio code"
    Me: *Laughs in overtype extension*

  • @aryesegal1988
    @aryesegal1988 Před 6 lety +2

    Awesome! Another javid video. Liked before seeing :)
    Thank you very much for these.
    Looking forward for more!

    • @javidx9
      @javidx9  Před 6 lety

      I need some sort of loyalty scheme for the long time supporters like yourself! :D

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

    Fantastic videos you make, so clear and understandable!

  • @mansursgmn
    @mansursgmn Před 6 lety +3

    Your channel should have much more views. I really enjoy your work. Cheers from Turkey!

    • @javidx9
      @javidx9  Před 6 lety +2

      Hi Mansur, Cheers! I dont mind the low numbers, as long as people enjoy the content and learn from it I'm happy!

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

    Thanks a LONG LONG INT number of millions for your fantastic videos! Keep them coming

  • @Andrew-wo8ry
    @Andrew-wo8ry Před 3 lety

    I use C and raylib and these tutorials are still very helpful, keep up the good work!

  • @hound4425
    @hound4425 Před 6 lety

    I am sad I found your channel so late, If I would know about it half year ago I could be completely somewhere else. Thanks for the good work!

    • @javidx9
      @javidx9  Před 6 lety +2

      Hi Karel, dont be sad! Code is something you can easily take with you wherever you are! Cheers.

  • @Angel-VTek
    @Angel-VTek Před 4 lety +1

    This is by far one of the best programming videos ive seen on YT.
    Totally OUTSTANDING!

  • @kushagra64
    @kushagra64 Před 3 lety +3

    Waiting for part 2 :)
    slopes and enemy could be a good topic

  • @howimetstarwars356
    @howimetstarwars356 Před 3 lety +1

    this is good ! This is enjoyble ! That project is not difficult or easy. I am watching your videos. Lots of fun (all videos). And Code-It-Yourself!

  • @andrewpitocchelli3523
    @andrewpitocchelli3523 Před 5 lety +1

    Been learning alot from your videos brother. thanks a ton.

    • @javidx9
      @javidx9  Před 5 lety

      Hey my pleasure Andrew, Cheers!

  • @seditt5146
    @seditt5146 Před 6 lety +2

    Very similar to the Collision detection I was using for the platformer I was Tinkering with Javid, Since many tutorials I see online suggest all sorts of stuff like checking every tile within specified vicinity etc .... Its nice to see someone else starting with the corners like I decided to do as well... I test the 4 corners, Then I test middle bottom +1 block in the Y axis to decide if the jump/falling Flag should be set or not.

    • @seditt5146
      @seditt5146 Před 6 lety +2

      How are you handling your sprites Javid? In mine I made a Sprite class that contains a Vector of States(IE:Various animation sequences for left, right etc) and the States contain a vector of frames so that I may enumerate the types of movement. I then overloaded the += operator so that Frames and States can be added as easy as picking a Rect from the sprite sheet and += it to the state or the state.frames..

    • @javidx9
      @javidx9  Před 6 lety +1

      In this instance my sprites are not complicated - just carefully placed on a sprite sheet so they can be accessed with minimal effort, os all my facing left sprites are on the top row, then all my facing right sprites on the next row down. Running (not shown in video) are sequential, so I just increment a counter in sprite space.

  • @chrochetfan7274
    @chrochetfan7274 Před 4 lety

    Really wish 2d platformers were more popular on this channel i love working on them

  • @eperez_yt
    @eperez_yt Před 3 lety

    I really enjoyed the video. Thanks! It helped me a lot! (: hope there is the second part.

  • @Komplexitet
    @Komplexitet Před 3 lety +4

    The bearded and wise one! We need a follow up! :D

  • @JarmamStuff
    @JarmamStuff Před 4 lety +1

    *Delivering a big thumbs up to help your self-esteem*

  • @user-ih7kj4ki7u
    @user-ih7kj4ki7u Před 4 lety

    I just found this channel, and I thought I knew stuff in coding... well I don't know anything, buy I will watch this video 20 more times, and try to code the same thing using this video, and watch past/future videos too.

  • @simplestickmation9834
    @simplestickmation9834 Před 5 lety +6

    24:12 good math concept

  • @joshuaeirman2197
    @joshuaeirman2197 Před 5 lety +6

    So cool, it's definitely, "replayable!"

  • @hman2875
    @hman2875 Před 6 lety +2

    Dude you are the best !

  • @johnson554671
    @johnson554671 Před 3 lety

    I would give you 10 thumbs up if I could! You showed in the intro the end result (which is always preferred), and you showed some awesome code. Thank you! Just a tip, maybe if you could spare the time, for your videos putting bookmarks is helpful. Great Work!

  • @ps5games821
    @ps5games821 Před 5 lety

    great game , you are the best , please make more big great games

  • @TheKhanQ
    @TheKhanQ Před 6 lety +2

    Well done. Thx for the video.
    Greetings

    • @javidx9
      @javidx9  Před 5 lety +1

      Greetings Dr Stick! Thanks!

  • @jakubsebek
    @jakubsebek Před 6 lety +1

    Finally new video! I will really appreciate if you will do some polygon collision math :) thank you

    • @javidx9
      @javidx9  Před 6 lety +1

      Hi Jacob, thanks! I will be continuing Balls collision with static polygons for the next video. Dynamic Polygon v Polygon is tough and requires torgue and rotation to be considered. This might be later in the year.

  • @jroseme
    @jroseme Před 2 lety

    The protag is you!!! Fantastic.

  • @Einhanderk
    @Einhanderk Před 5 lety +1

    Amazing his canal.Parabéns!

  • @markismiller6484
    @markismiller6484 Před 3 lety

    Would love to see a code along with me video. Where you code something and record it in a way to where we can type what you are and you can explain each line as we type it out. would really help me a lot with memorization. Just a steady shot of the codieng screen no cuts while we code along you learn more that was then just going to the page you have posted copying it over and then reviewing what you have copyed while the video plays. to many cuts for me to type out the code like you do while your talking about it and you code fast so i keep haveing to pause to keep up lol. thanks for all the awasome videos!

  • @dragonore2009
    @dragonore2009 Před 3 lety

    This jumping scheme with gravity effect with some control you put in out does Ghost N Goblins jumping that is for sure.

  • @bjbell52
    @bjbell52 Před 3 lety

    I'm retired and need something to keep my brain turning into mush so I decided to write a game for the Atari 7800. The game I picked was Apple Panic from 1981 that was on the Apple and the Atari 800. So far, on my own I've managed to built the screen using tiles, created my sprite, created a running sequence for left and right movement and I'm working on moving vertically. I've discovered a few of your routines by myself but your video is going to be a HUGE help in smoothing things out. I'm going to try to work your techniques into my code. Sadly, Atari 7800Basic is limited (I think because the end result will be 6502 code and hardware driven) but it does have floating point. I will have to keep coming back here for more help.
    Thank you very much for making this video and I will check for other video you've made. I wish I could send you a clip of what I've done so far. It represents about 4 weeks of work using a language I don't know on hardware I don't know but so far so good.
    Thanks again.....

    • @javidx9
      @javidx9  Před 3 lety +3

      Heh, it's I'm relying on code to keep mentally active too! I'm pleased you've found the video useful, thanks!

  • @eternal6983
    @eternal6983 Před 6 lety

    Subscribed, you deserve my sub.
    However, i would like to see some OpenGL / D3D stuff in the future.
    Keep up the great work tho!

  • @szaman6204
    @szaman6204 Před 3 lety +1

    perfect movie

  • @ogr2
    @ogr2 Před 4 lety

    Great tutorial, I hope it will be an update for the PixelGameEngine.

  • @PauloConstantino167
    @PauloConstantino167 Před 6 lety +3

    You are the nicest youtube programmer. Love the pace and atmosphere of your videos. Keep on the great work! You might want to try the Borland C++ Builder environment for these projects. It provides the Canvas object where you can draw shapes and bitmaps on the screen with a single line of code. It provides ready-made windows forms for you to work on. I always use it for quick projects. it would be perfect for these projects of yours, including anything in 3D. If you look on my channel on my latest videos, I posted a 3D engine I wrote in Borland C++ Builder.

    • @javidx9
      @javidx9  Před 6 lety +2

      Hey Paulo (again!) Thanks buddy, i try to get the message across without bloat and noise! I checked your channel and love your 8bit computer! Ive not used borland tools since Turbo Pascal and Turbo C++ 😁 i will be making the jump from console soon enough so ill look into it! Cheers!

    • @Kr3m_
      @Kr3m_ Před 5 lety

      @@javidx9 I was just thinking the same thing when reading this. I was pretty sure Borland was at least still around, but haven't used it in probably close to 2 decades now. In recent years, GCC more than anything. Heck, the only reason I installed Windows for the first time in years was to check out a C# project based on MonoGame that has special tools made in WPF that I'd like to port to Linux at some point, but am having too much fun with at the moment.

  • @roberthowell1224
    @roberthowell1224 Před rokem

    just started programming like this week. so far i have a box and a bear in the box that shoots lazers. was trying python now going to c++

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

    Really interesting video! Any chance for part 2?

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

    Hold up a sec - you're telling me all that time this was running on a command line?!

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

    Hello,
    I really look forward to following along with your video. I checked out your code on github and I was hoping you'd be willing to briefly explain how to use this code? Do you only need the code from the main page, or do we need separate files or classes as well?

  • @deepinside4479
    @deepinside4479 Před 3 lety +1

    Have you got any basic videos on how to great a window / fundamentals of setting up?
    edit : like how you created the one lone coder console game engine?

  • @antling_
    @antling_ Před 6 lety +1

    I've been following your channel for a little while now. I think it's time to subscribe :]

  • @CmdrKroz
    @CmdrKroz Před 4 lety +6

    Silly question - this video has #1 in the title. Was there ever a part 2? I think 2D platformers are a great topic, and would love to see more!

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

    Great video.

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

      Thanks Chuck!

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

      javidx9 Really have enjoyed going back through your vids. I’m currently writing a library for a compiler for the ZX Spectrum Next, which handles a lot of similar things as your consolelib so it’s been really useful to see how a proficient and competent coder approaches this. My lib presents subroutines to the end user that then gets converted into z80 assembly for speed and space efficiencies, so a lot of compromises have to be made to make it work. Hopefully I’ll try and do something with you libs when I find some free time.

    • @javidx9
      @javidx9  Před 5 lety +1

      Oh very nice a sort of old-skool Macro library.

  • @floatingdoor
    @floatingdoor Před 5 lety

    Hope this is ok to comment here but if anyone’s in need of music I’m looking to work on a project. Thanks for the upload!

  • @xCMLicious
    @xCMLicious Před 5 lety +1

    Hey! I love your video on how to create a platformer game! It really teaches me alot on what I require! Just a quick question. you mentioned that you created an array to read in the alphabets. Am i able to use FileIO to read into it from a textfile and then do the same stuff for the rest of the video?

    • @javidx9
      @javidx9  Před 5 lety +1

      Cheers! Yes of course you can read in the levels from a file. Its just text in this case. I do something similar in my RPG series.

  • @digo8167
    @digo8167 Před 6 lety +2

    your coding all the fun stuff! l

    • @javidx9
      @javidx9  Před 6 lety +1

      Hi Diego, you should only code fun stuff! Not worth doing otherwise 😁

  • @HediDev
    @HediDev Před 3 lety

    Hi Sir , i wanna ask you , about a specefic path to follow in order to be able to make a game in c++ like you do , because i always find out that i don't understand a lot of things because i skipped them in the learning curve ,tell me for example what should i learn first , Thanks in advance , this will help me a lot :)

  • @mryup6100
    @mryup6100 Před 5 lety +1

    Hey so I know c++ quite well as language but there is some syntax I don't understand that seems to be part of Visual Studio Code. For example: DWORD and L" ". Where does one learn about those?

    • @moppy4049
      @moppy4049 Před 4 lety

      From another comment: "It indicates that the following character or string literal is encoded in a unicode or multibyte format."

  • @seanbowers6036
    @seanbowers6036 Před 6 lety +13

    Hi Javidx9! I just wanted to give a big thank you for your videos. They are amazingly informative and helpful. Many years ago I did a bit of programming but fell away from it after becoming more involved in systems administration. Now I'm getting back into it and find your style of instruction just my cup of tea. I've a huge fascination for roguelikes and mazes, 2D cRPGS, and procedural terrain/cave/overworld generation. A long time favorite game of mine has been Dwarf Fortress and any game in a similar style (nethack, ADOM, Caves of Qud, Cogmind, etc). As a player of pen and paper D&D I love the tables of stats that these games produce. What games, if any, are your favorites?
    I'm finding the Visual Studio 2017 IDE easy to use as a general text editor, but there is so much depth to it that I oftentimes find myself lost. For example, your recent solutions have shown several projects contained within. I'm not able to replicate this sort of container/structuring in my own solutions. I typically just make one solution and inside that the .cpp and .h files where need. Would you consider a tutorial on the IDE that could cover such things? I'm keen on learning how to best use the tools at hand and not just use them like notepad.
    Again, thank you for such quality videos and sharing your passion.

    • @javidx9
      @javidx9  Před 6 lety +2

      Hi Sean, Thanks so much for your support! Its great to see people dusting off their IDEs and giving things a go. I like the procedural nature of roguelikes too, and find that aspect perhaps more interesting than the game :D As for my favourite types of games, that's quite tough. I like games that don't assume the player is dumb, and that have a level of craftsmanship that turns it into art. Something like The Witness is a brilliant example of this, on the surface such a simple game, yet extraordinarily powerful in how it evolves over play. That said, I like blowing stuff up to! Sadly I dont have as much time to game as I used to, so I lean towards games that I can finish quickly. I dont relish the thought of dumping 120 hours into a game anymore, however, Ni No Kuni 2 is just around the corner lol.
      I think a video on Visual studio would be a good idea. I've done one on using VS debugging tools, but perhaps an all rounder of tips and tricks would be fun. You're right as soon as they become a tool that you can use second nature they become very powerful indeed. I need subject matter for a series of quick videos I want to do, 5-8 minute videos max, in between the usual output.

    • @lone.wo1f
      @lone.wo1f Před 4 lety

      @@javidx9 sir, please continue this 2D platform game... Other people may have covered this topic, but your explanation is awesome...

  • @evolgenius1150
    @evolgenius1150 Před 3 lety

    It's super Jario! He's a... french electrician.

  • @ajackslicks8866
    @ajackslicks8866 Před 5 lety

    How do I run this program on a mac? I've been trying for hours to find answers ,but it seems it's only plug and play for windows.

  • @Dhurgan
    @Dhurgan Před 3 lety

    Love the video, explains things very easily...
    But I don't quite get the font change, what does that do, I see no difference?
    Possibly it's a raster like pattern in the former font? That could be YT Compression artifacts though...

  • @partisanpuff9861
    @partisanpuff9861 Před 6 lety +4

    Sorry for the naive question, is your code compatible on UNIX systems?
    Love your videos!

    • @javidx9
      @javidx9  Před 6 lety +3

      Hi Partisan Puff, thanks! Off the shelf it is not compatible. However a few of us on the discord are working on an SDL version. I try to make the algorithms and concepts cross platform and cross language, but the consoles are very different on unix and Windows. Watch this space though!

  • @kanito107
    @kanito107 Před 6 lety +1

    mine says the end of my switch loops curly bracket is a syntax error?? how come?
    edit:Turns out i needed a "break;" after the default to make it work. Thanks Dave.

  • @raymondstpaul4913
    @raymondstpaul4913 Před 5 lety +1

    Another question what if I want use an image from another software such as Adobe Photoshop, Lightwave 3D or even Hitfilm Pro?

    • @javidx9
      @javidx9  Před 5 lety

      The easiest way is to convert png files to the spr file format I use in the console. It might be easier for you to start with olcPixelGameEngine, its the same in everyway but uses conventional image formats.

  • @GhomezAnonimous
    @GhomezAnonimous Před 4 lety

    Trying to implement in Java, everything seems interpretation-able except collision left and up collision work fine right collision heads down and down collision heads right??? so frustrating :( using same collision If's but using a tick(up,down,left,right) and render(Graphics2D g) system also separated player and level logic into respective classes any idea what might be wrong can post code/project if needed - great vids btw

  • @matteoelprincipe
    @matteoelprincipe Před 3 lety

    I don't understand why, but sometimes when Jario moves fast and the program starts to get laggy, then Jario is able to break the collision rules, for example he can get through walls.
    Is it an implementation problem?
    Notice that I've had to reduce the size and the resolution of the screen, in the original resolution 256X240 with size 4x4 the program opens up just a narrow black square.
    Thank you!

  • @michaelpacheco7421
    @michaelpacheco7421 Před 5 lety

    Awesome! Nintendo does not get ungry with you, yet!

  • @ohtych1004
    @ohtych1004 Před 4 lety

    Even though I’m way too late,
    How do I include the olc into my program? I downloaded the old game engine in a zipped file but I don’t know how to include into the program. Thanks!

    • @javidx9
      @javidx9  Před 4 lety

      You only need the header file, just copy it into your project folder and include it in your program.

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

    I really love the video and the simple approach to collisions. I'm implementing it in Lazarus/FPC wich is what i have and i'm used to (planning a small game for my kid). I wonder if the collision detection can work if the tile and the character hit-box are different sizes because all calculations are done in the unit-less space.
    Maybe if sprites are a multiple of the tiles? For example if the sprite is 2 "units" tall and 1 "unit" wide (I'm thinking in a small Jario / big Jario situation).

    • @javidx9
      @javidx9  Před 5 lety +1

      Hi and thanks Zobook, you can use different size sprites to tiles and it should all work ok, until... You use a sprite that is at least 3 tiles high. I only check the four corners of the sprite so it is very possible a tile could fall in between the corners.

    • @zobook
      @zobook Před 5 lety

      @@javidx9 thanks, so we are safe in the 2x1 sprites. I'm trying with a sprite that is 1.5 tile high but the hitbox is 1 tile high, the image overlap a little but is a satisfactory solution

  • @ugopiers1212
    @ugopiers1212 Před 3 lety

    If you have some trouble with the non pixel perfect (0.9f) approach (like I do), a simple workaround is to ignore the (bottom tile for x detection || right tile for y detection) if you're currently on a tile (no decimal position).
    Which leads to something like that:
    bool ignoreBottomTile = ((int)(player->getOldPosition().y) - player->getOldPosition().y == 0);
    Tile* nextTile = ignoreBottomTile ? nullptr : map->getTile(player->getPosition().x + 1.0f, player->getOldPosition().y + 1.0f);
    if(previousTile != nullptr && previousTile->isSolid() || nextTile != nullptr && nextTile->isSolid()){ misplacementCorrection()}
    It really is a psychorigid problem, but some may be... :s
    Anyway, keep the good work on those tutorials, they are awesome !

  • @lukehope4484
    @lukehope4484 Před 4 lety

    Is this c++ or C# have to specifically make a game using visual studio 2017 and monogame and it has to be done in C#

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

    Really great idea about doing a video on Super Mario👍🏻

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

    i came to this one from the 3d graphics engine one and now i want to make a platformer with 3d graphics and physics like you would see from a company. T_T it's gonna be hard but someday.

    • @javidx9
      @javidx9  Před 5 lety +3

      Kyle, just keep reminding yourself the computer will only do what you tell it to do - nothing is impossible. Good luck with your projects!

  • @Cruzazulini
    @Cruzazulini Před 3 lety

    Does anyone know if games like Geometry Dash or The Impossible Game are tile-based (do they use huge 2d arrays to represent entire levels)? Or are they made in a different way?

  • @tails_the_god
    @tails_the_god Před 3 lety

    Hmm I was thinking can you show how to go down pipes to get to secret areas?

  • @firecode3495
    @firecode3495 Před 6 lety +3

    sorry i have a question , what engine is this? sdl, allegro? or something write from you on c++?

    • @javidx9
      @javidx9  Před 6 lety +6

      Hey, this is the Console Game Engine - its something I created, that runs in the Windows command prompt. Ive a number of videos about it on this channel.

    • @firecode3495
      @firecode3495 Před 6 lety +2

      javidx9 great i m new here i like your channel. Thanks.

    • @javidx9
      @javidx9  Před 6 lety +4

      Hey, start here! czcams.com/video/u5BhrA8ED0o/video.html

  • @copperfox3697
    @copperfox3697 Před 6 lety

    Hi!
    Thank you so much for this video, it's really helpfull :)
    However, I have a question: I'm running my code on visual studio, I included the olcConsoleGameEngine.h to my project, but I don't know why, when I run the program, Visual Studio just stops working, and the window from the console does not open properly (it's really tiny)... Do you know where this could come from? Because it appears I don't have any errors in my code :/
    Again thank you so much for your videos!

    • @javidx9
      @javidx9  Před 6 lety

      Hi Copperfox, this sounds like its struggling to create a console of the required dimensions! Firstly, which OS are you using, and secondly, what is your primary display (monitor) resolution? Thanks, I'm pleased you found the video informative, and I'll try to get you up and running!

    • @copperfox3697
      @copperfox3697 Před 6 lety

      I'm with Windows 10, i'm using visual studio 2017 and my display resolution is 1536 x 864
      Thank you for your quick reply!

    • @javidx9
      @javidx9  Před 6 lety +1

      Ok that might be your problem. That program defaults to 256x240 with a 4x4 pixel. This means you need at least 960 pixels in order to create the console. Fortunately, if you specify the pixel size to be 2x2 where the ConstructConsole function is called it should fit.

    • @copperfox3697
      @copperfox3697 Před 6 lety +1

      That was the problem, it's working now, thank you so much!

  • @theworstofyoutube1946
    @theworstofyoutube1946 Před 5 lety +1

    Hi, I love your videos!
    I had a little issue. When I pass the parameters into the game.ConstructConsole(160,120,8,8)
    It gives me an error of screen and font size too large. The only work around this is by using 80,60,4,4 but that makes my window very small.
    How can I solve this?

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

      Hello, It depends on the size of your desktop resolution. 160,120,8,8 needs a 1280x960 display. Some laptops wont have this. So you can try reducing the font size (4,4) to (2,2) and keep the original resolution intact.

    • @theworstofyoutube1946
      @theworstofyoutube1946 Před 5 lety

      @@javidx9 thank you so much!
      It works great now and I made my first game thanks to you. It helped me clear a lot of my concepts of C++
      Cheers

  • @michaldvorak2230
    @michaldvorak2230 Před 6 lety +2

    Love your videos. I'd also appreciate if you could do a video talking more about game engines and perhaps how they work compared to your OlcGameEngine.. not sure how much of a viable topic that is, to be honest, just a suggestion (y)

    • @javidx9
      @javidx9  Před 6 lety +1

      Firstly Thanks! Hmmm, comparing other engines would make a good video, but its a great deal of work. That said, the community surrounding this channel are using all sorts of engines, so I could consult with them. In principle there will not be much difference (at the most fundamental level), but modern engines will have very sophisticated tricks to help with asset management - something I dont (and dont need to) care about. You've given me an idea!

    • @michaldvorak2230
      @michaldvorak2230 Před 6 lety +2

      I'm actually more intrigued to see how the 'transfer' from a console to more powerful graphical interfaces works.

    • @javidx9
      @javidx9  Před 6 lety +2

      You know what, that's a good thing to demonstrate and perhaps the time is right to show people that taking the leap from my simple engine to a more complicated one is not that difficult. I'll add this to the list.

    • @michaldvorak2230
      @michaldvorak2230 Před 6 lety +1

      Thanks!

  • @spikespike2252
    @spikespike2252 Před 3 lety

    Hey, very nice video, quick question does this program runs with only 1 cpp and 1 heather file (the engine) on the console game solution? or does it also needs to have the sprite editor, relay servers etc...

  • @trrblast7273
    @trrblast7273 Před 4 lety +1

    What typ of project did you use?

  • @khanhchung4103
    @khanhchung4103 Před 6 lety +6

    How can I start to learn from your videos? I watched some videos but I dont really understand completely. Should I learn C++ first and then move to your videos later?

    • @javidx9
      @javidx9  Před 6 lety +5

      Hi Khanh, thats a great question! Admittedly, my videos probably do require that you are familiar with programming basics. I try to create programs and algorithms that can be easily implemented in other languages - the fact I use C++ is secondary. At the same time I hope to demonstrate that C++ is not to be feared, and is a valid entry level language too. If you are not familiar with C++ then yes, try and understand the very basic syntax and variable types, and then attempt some of the shorter, simpler videos first, like Snake! Most of the difficulty comes form some of the API functions I use, which is not a C++ problem, more of a platform issue. Good luck!

    • @khanhchung4103
      @khanhchung4103 Před 6 lety +1

      javidx9 Hi javidx9, thank you so much

    • @dvirarazi7351
      @dvirarazi7351 Před 6 lety +2

      khanh chung I really recommend starting to the learn the basics from cplusplus.com

  • @rafaykashif7662
    @rafaykashif7662 Před 5 lety

    Great tutorial, however I am having an issue with the program. Whenever I try to debug the program, it just creates a very small window with nothing on it, and the output says the program exited with a code of 0. How should I approach this?

    • @javidx9
      @javidx9  Před 5 lety

      Thanks Rafay, sounds like the console that is too big for your display. Try halving the fontw and fonth values in construct console function.

  • @markismiller6484
    @markismiller6484 Před 3 lety +1

    I'm pretty new to all this have to say but one think that getting me is I'm spending so much time watching tutorials and trying my best to learn these things while not wanting to directly copy someones code while learning it. i watch your video along and am typing in the code as you do but then i see on the page you have posted that i could just copy and past the code over but that is lame its going to take forever for me to know coding enough to be able to just code something without looking up someone else formula. For now its fun i guess to follow along typing in the code getting familiar with what each line dos and then making my own art to put into the game so yeah I'm following someone else code but I'm putting my own spin on it with my art.

  • @moppy4049
    @moppy4049 Před 4 lety

    How are you getting so many frames per second? VS isn't using much of my resources and I'm getting between 30-40 fps constantly.
    Edit: chaning from debug to release mode increases your frames

  • @SqwareCircle10
    @SqwareCircle10 Před 4 lety

    what did you use to make this, in NetBeans

  • @dorjderemnamsraijav5182
    @dorjderemnamsraijav5182 Před 4 lety +4

    Any tips if I want to add slopes to this project?

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

      *O O F*
      Slopes pretty much break the concept; that's when you need geometry. You'd need special tiles, special character sprites for up/downslope action, and collision test that work on 2y + x (if your slopes are half a tile high and a tile wide) and 2y - x.
      The many issues with slopes are the reason why some platformers use fans or magnets to exert lateral forces; they do so without upsetting the underlying geometry.

    • @dorjderemnamsraijav5182
      @dorjderemnamsraijav5182 Před 3 lety

      @@achtsekundenfurz7876 thank you

  • @roberthowell1224
    @roberthowell1224 Před rokem

    can i do the same thing with c++ and unity ? or is that over kill

  • @raymondstpaul4913
    @raymondstpaul4913 Před 5 lety +1

    Am interested in making a game but know nothing of C++ can you please give me advise on what I need to learn? An software I need to get?

    • @javidx9
      @javidx9  Před 5 lety

      Hi Raymond, it depends on the scope of the game you want to make, but if you are just starting out keep it simple! Start with basics loops and control before moving onto topics like OOP. You will really need the basics down to a solid understanding. I use Visual Studio to program in C++, its free, but C++ can be a bit fiddly at first. Many people have a lot of success starting with Python as its got lots of utilities and tools already made to get games up and running quickly.

  • @Naman.aggarwal09
    @Naman.aggarwal09 Před 3 lety

    can you please give a link for download mario image u use please

  • @suhoihn7995
    @suhoihn7995 Před 3 lety

    How do you handle slopes in a tile-based game?

  • @Mark00747
    @Mark00747 Před 3 lety

    I have just downloaded the olcConsoleGameEngine.h and OneLoneCoder_PlatformGame1.cpp files, and added both to my solution. As a beginner C++ programmer, I was surprised to see no errors occurring. However, the result is not as expected: I can only see a part of the level, with a blue background and the blocks in black, without any user input possible. Could you please take a look at what could cause this? Perhaps VS2019 requires some different code? I have a Windows 10 machine btw.

    • @javidx9
      @javidx9  Před 3 lety +1

      You need the spr files too that contain the image dats

    • @Mark00747
      @Mark00747 Před 3 lety

      @@javidx9 Thank you!! It works
      I'll try to code it myself now :)

  • @VanillaMidgetSSBM
    @VanillaMidgetSSBM Před 6 lety +1

    I wonder if you could port these to other CMD accessible languages like C# or others.

    • @javidx9
      @javidx9  Před 6 lety +4

      Hi Guzma, you can and some have. Check out the community showcase video!

    • @VanillaMidgetSSBM
      @VanillaMidgetSSBM Před 6 lety +1

      Oh boy, my inner nerd is trembling in joy that I wasn't the only one who thought of it!

  • @davidaddico4479
    @davidaddico4479 Před 4 lety

    what type of file did you use

  • @alejandraordonez9734
    @alejandraordonez9734 Před 4 lety

    Please, how can i make the same in c#?

  • @olivierarguimbau6537
    @olivierarguimbau6537 Před 3 lety

    Hi. Thanks a lot, solve some problems in my collision detection routines.
    I'm sure you won't see that comment after two years of publishing but...well :)
    One question about the code on line 220 : why do you test "less or equal to zero ?" :
    if (fPlayerVelX 0) { //right... }
    I think it's a "speed coding" line with no real slow down on performance (on PC at least) but i'm a perfectionist so may be i'm wrong ?
    Another thing makes me perplex.. speed Y is camped at +100 / -100, i don't know the "fElapsedTime" value (may be 0.02 ?) cause i'm using another platform but it can be greater than 1 then greater than one tile and we can "pass through" some tiles vertically ? Am i wrong ?
    See no offense , i'm developping games for fun and have to learn "game specific" part of development so it's real question :)
    Thanks again for sharing your knowledge !

  • @garionaolinger8752
    @garionaolinger8752 Před 4 lety

    help please
    am using this tutorial and downloaded all the files like have been said and typed the code identically to the tutorial but it keeps giving errors that certain codes like the GetKey codes are undefined
    what should i do i am so lost

    • @JerreBaas
      @JerreBaas Před 3 lety

      Did you add the olcConsoleGameEngine.h file in the project map and then added the olcConsoleGameEngine.h file via the solution explorer to the header file?

  • @autergame
    @autergame Před 5 lety +1

    sprite render and loader is this:i.imgur.com/gobGZDr.png or this:i.imgur.com/UggYUFJ.png
    more explication: i.stack.imgur.com/m4C1T.png

    • @javidx9
      @javidx9  Před 5 lety +1

      Option B, I always loop x outside, y inside.