Vertical Platformer Game Tutorial with JavaScript and HTML Canvas

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 พ.ค. 2024
  • This course was made possible thanks to Hostinger (a really great hosting service). Save up to 91% of by using the discount code CHRISCOURSES on checkout at www.hostinger.com/chriscourses
    Demo: chriscourses.xyz/
    Game assets: drive.google.com/drive/folder...
    GitHub source code: github.com/chriscourses/verti...
    Tiled map editor: www.mapeditor.org/
    Warrior Art by Luiz Melo: luizmelo.itch.io/medieval-kin...
    Background Art by Trixie: trixelized.itch.io/starstring...
    0:00 Project summary
    0:58 Project setup
    8:55 Domain setup
    16:15 Gravity
    33:35 Player movement
    42:50 Background sprite
    57:22 Collision blocks
    1:29:54 Collision detection
    1:51:31 Sprite animation
    2:16:19 Hitbox implementation
    2:32:09 Sprite swapping
    2:56:33 Platform jumping
    3:11:27 Horizontal camera panning
    3:31:13 Vertical camera panning
    3:41:06 Launch final product to Hostinger

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

  • @ChrisCourses
    @ChrisCourses  ปีที่แล้ว +54

    In regards to having your game run on a live URL, I personally believe Hostinger is the the best shared hosting solution you can find at the moment-it's much simpler to set up than other solutions like GoDaddy and Bluehost (I've used both of these plenty of times throughout my 10 year development career), and the overall interface is cleaner too. This is the only video of mine where you can get a deal with them right now, so for a discounted rate, you can use www.hostinger.com/chriscourses and the coupon code CHRISCOURSES

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

      Something cool to add would be a platformCollision viewer.
      PlatformCollision being an array. With mouse movement and determine size of array element its pretty easy to track where the mouse is in terms of the map. Then just change right element index on click to 202 values.
      Maybe something to add in future? :)

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

      Please man make map in game that tells you were are you

    • @brunoferreyra3486
      @brunoferreyra3486 29 วันที่ผ่านมา

      O

    • @tara-nay
      @tara-nay 21 วันที่ผ่านมา

      Wq

    • @darthpromenaderpaprika5252
      @darthpromenaderpaprika5252 16 วันที่ผ่านมา

      Jktttktkkttwttwtwtwtwtwtwttwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwttwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwttwtwtwtwtwtwtwtwtwtwtwtttwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwttwtwtwtwtwtwtwtwtwtwtwtwtwtwtwtwttwtwtwtttwtwtwtttwtwtwtwtwtwtwtwtwtwwtwtwtwtwtwtwttwtwtwtwtwtwtwtwtwtwtwttwtw🎉😂🎉😂🎉😂🎉😂🎉😂🎉😂🎉😂🎉😂🎉😂🎉😂🎉😂🎉😂🎉😂🎉😂🎉😂😂🎉🎉😂🎉😂🎉😂😂🎉🎉😂🎉😂🎉😂🎉😂🎉😂🎉😂🎉😂🎉😂😂🎉🎉😂🎉😂🎉😂😂🎉🎉😂🎉😂🎉😂🎉😂🎉😂🎉😂🎉😂🎉😂🎉😂🎉😂🎉😂🎉😂🎉😂🎉😂🎉😂twtetwtwtwtwttwtwtwtwtwttwtwwtwtwtwtwtwtwtwtwtwtwttwtwtwtwttwtwtwtwtwtwwwwtwttwtwtwtwwtwttwwwttwtwtttttwtwtwtwttwtwtwwtwtwtwtwttwwtwwtwtwtwtwtwtwtwtwtwtwtwwtwtwttwtwwtttwtwtwwtwtwtwtwtwtwwttwwtwtwtwtwtwwtwtwttwtwwtwtwwtwtwtwtwttwwwtwwt😂twwtwwtwtwtwwwtwwwtwwtwtwwtwtwttwwwwtwtwttwtwwwwtwtwtwtwtwtwtwtwtwwtwwtwwtwtwtwtwwtwwtwwwww😂😂😂eetetwwwwwtwtwtwwwtwtwtwtwtwwtwtwtwtwtwtwwtwwtwtwwtwtwwtwtwwwtwtwtwwtwtwwwtwwww😂twtetwwtwtwtwwtwwttwtwwtwtwwtwttwtwtwwwtwwtwttwtwwtwtwtwtwtwwtwtwtwtwtwwtwtwwwttww😂😂😂😂😂😂😂😂😂😂😂😂teetetwwwttwtwtwwtwtwwtwwwwtwwtww😂teettewrwwtwwtwwttwwwwwwwww😂😂😂😂😂😂🎉😂😂😂😂😂🎉😂😂😂🎉😂🎉😂🎉😂😂😂🎉😂🎉😂😂😂😂😂🎉😂🎉😂😂🎉😂🎉😂😂🎉😂😂😂😂🎉😂😂😂🎉😂🎉😂😂😂😂😂🎉😂😂😂😂😂😂😂😂🎉😂😂🎉etwwtwwtwtwtwwtwtwtwwwwwwwwwww😂😂wwtewtwwwwwwwtwtwtwwww😂wwwwwwwwwwtwwwwwwwwwwwwwwwwwwwwww😂😂😂😂😂😂😂😂😂😂😂twwwtewwwwwwwtwwwwwwwwwwww😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂🎉😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂

  • @cedric_mllr
    @cedric_mllr หลายเดือนก่อน +232

    Bro i keep falling asleep and always get these multiple hour long videos of creating games

    • @Oxyopiia
      @Oxyopiia หลายเดือนก่อน +6

      actually me

    • @account-pi3nj
      @account-pi3nj หลายเดือนก่อน +4

      On god!

    • @ricelordalt9183
      @ricelordalt9183 หลายเดือนก่อน +4

      This is my second time

    • @greatswiss4252
      @greatswiss4252 25 วันที่ผ่านมา +7

      The same, when i wake up i see that YT algorithm gave me vids that i don't watch like programming tutorials.

    • @Gumisprettygood
      @Gumisprettygood 24 วันที่ผ่านมา +7

      I’ve been falling asleep to YT the last couple days and every morning when I wake up it’s always on this specific video

  • @d0senB13R
    @d0senB13R 28 วันที่ผ่านมา +29

    I woke up here again!

  • @micemincer
    @micemincer ปีที่แล้ว +130

    edit: So you people know - this is the only yt channel with 0 - 100 tutorials on this subject and without clowning, with some tolerable product placement and with professional content and host. Better to download so it never get lost.

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

      “Without product placement”? LOL

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

      @@ThomasGiles LOL - don't watch it then

    • @oliveryt7168
      @oliveryt7168 ปีที่แล้ว +10

      @@micemincer simply correct your statement since it's not true... why so salty?

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

      @@oliveryt7168 corrected

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

      @@micemincer oof the salt

  • @m1kegame_dev456
    @m1kegame_dev456 23 วันที่ผ่านมา +2

    I love these videos, I do. But I am getting g sick and tired of waking up to them

  • @trixelized912
    @trixelized912 11 หลายเดือนก่อน +5

    It's surreal gaining interest in web game development and seeing your own stuff pop up. Thank you for using my tileset!! I never expected people to like it all that much, I mocked it up in a few days '^^

    • @ChrisCourses
      @ChrisCourses  11 หลายเดือนก่อน +1

      Awesome, definitely one of the best looking tile sets I found on itch.io, thank you for making it available for use!

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

    I appreciate the production quality of these videos.

  • @ej3fm494
    @ej3fm494 4 หลายเดือนก่อน +1

    Your tutorials are so detailed and easy to understand. I appreciate your work on these videos !

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

    dude thank you so much for this tutorial, I came from c/c++ to java script, and I was hating it like crazy, because I had no main function and while loop, and the for loops will crash on my side constantly, the way you are explaining java script makes a lot of sense, thank you!

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

    Seriously the quality of your videos are so good! Story-telling is perfect.

  • @collinsk8754
    @collinsk8754 4 หลายเดือนก่อน +2

    Excellent OOP principles in a fun and practical way! Thank you! 👏👏

  • @nikolaikilt
    @nikolaikilt 5 วันที่ผ่านมา

    I am loving your clear explanations and how you go through the code. It is very fun to learn like this! Keep it up!

  • @FoxSock
    @FoxSock 9 วันที่ผ่านมา +1

    i dont know how i got here, i dont know how i got 11 minutes in with no fucking clue that i was even watching this, but i feel marginally smarter, so thank you

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

    omg 1 minute in and already know this makes for a great weekend project thanks!

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

    It Tooks me 2 days to understand and built this project by your video very nice video and explanation keep growing may your channel get a million subscriber .

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

    Pro tip: In Sublime, you can save the file name directly if you write it on the first line, and press Ctrl/Cmd + S and Enter/Return. I always do Ctrl + N , write the file name in the first line of the file, Ctrl + S, Enter, Ctrl + A, and start typing whatever.

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

      Pro tip: Use VSC instead of sublime ;D

  • @-Hari-03
    @-Hari-03 2 วันที่ผ่านมา

    accidentally watched over 3 hours of this while asleep.
    edit: damn this is actually good wtf

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

    So far this is the only proper Javascript game tutorial I have ever seen👆👍
    👍👍

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

    Fantastic and professional video, thank you.

  • @its.arjun.s
    @its.arjun.s ปีที่แล้ว +12

    You're stuff is amazing! Very informative.
    Also, could you tell about how you would go around making a replay system for a game?

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

    Chris, the effort, time and love you put into your tutorials is VERY MUCH appreciated. Words can hardly express how much I appreciate what you are publishing here on this channel. The code is easy to read and easy to follow along. For me as a former C# developer (about 12 years ago, back in the days) this is very helpful.
    I wanted to write a ToDo-List app using HTML and JavaScript. Then I stumbled upon your TH-cam channel, now I seriosly need to create a 2d platformer :). After I am done with this course here I will definitely check out the premium stuff on your homepage

  • @sonomacoastfilms
    @sonomacoastfilms หลายเดือนก่อน +1

    so awesome... man I wish I knew this like 30 years ago

  • @JorgedelCampoAndrade
    @JorgedelCampoAndrade 9 หลายเดือนก่อน +4

    Simply grateful for this great tutorial and all your background work to complete it and share it.

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

    I'm enjoying this course a lot and I can't wait for the next steps. I'm trying to use classic sprites in your development, but when I dowload a sprite sheet, animations frames are not the same width. My question is: should I adapt development to get position, width and height for every frame or preprocess sprite sheets?

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

    @Chris Courses @3:08:25 your method to fix this is one way to fix it, but a better way to fix it (especially in very fast simulations) is to untie your update loop from your render loop. Using this will make you able to set your velocities essentially infinitely fast while still updating in between the position based upon delta time. It does make physics much more cumbersome to deal with in games, but it also preserves things like a velocity going so fast that it can warp through collision detections. It will also make physics much more predictable in that it doesn't matter what speed the RAF is firing, the player jumping will remain consistent in rising and falling.
    Here is a boilerplate I use to achieve this, however any value being modified in this.update needs to be multiplied by that dt argument to simulate the "in between phases" that aren't going to be drawn on screen. Think of them as intermediate updates between render frames. I included a dumbed down version of an enemy class to show how it can be used.
    class Enemy {
    constructor(args) { //whatever }
    update(dt) {
    //example of how to use delta time
    this.x += this.vel * dt
    }
    render(ctx) { //etc }
    }
    class Game {
    constructor(){
    const canvas = document.createElement('canvas')
    document.appendChild(canvas)
    this.ctx = canvas.getContext('2d')
    this.dt = 1/60
    this.last_time = 0
    this.accumulated_time = 0
    this.entities = []
    this.entities.push(new Enemy(args))
    }
    tick(time){
    this.accumulated_time += (time - this.last_time) / 1000
    //if a user leaves the tab. RAF will stop firing, however the following while loop condition could get stuck otherwise due to time still increasing. this is a stop limit in those cases:
    if (this.accumulated_time > 200)
    this.accumulated_time = 200
    while (this.accumulated_time > this.dt){
    this.entities.forEach(e => e.update(this.dt))
    this.accumulated_time -= this.dt
    }
    this.entities.forEach(e => e.render(this.ctx))
    this.last_time = time
    //mock pretending if client got 5fps behavior
    //setTimeout(this.tick.bind(this), 1000/5, performance.now())
    requestAnimationFrame(this.tick.bind(this))
    }
    }

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

      I had to research a lot on this and should probably give credit to Glenn Fiedler "Fix Your Timestep" article he wrote a few years back. He wrote his in java and I tailored it for JS in my example, but it works pretty solidly even with very fast moving objects and collisions.

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

    This is some amazing stuff. You got a new sub! also can i ask for something? Can you provide a tutorial on how to animate a character with just body parts and not a sprite sheet? If that is too much in vanilla maybe create a bone animation in spine or something and implement that in a game. Really can't find much material on that. Thank you!

  • @vitoralecrim
    @vitoralecrim 11 หลายเดือนก่อน +3

    Hello, fantastic class! I'm really enjoying it! I have a question. Once I complete the entire project, I'd like to replace the warrior sprite with one I discovered, but it has a different height. Is there a method to modify the crop box in order to scale any sprite height to a specific size for the player sprite? This way, I can easily switch sprites without concerning myself with their actual dimensions.

  • @SandeepKumar-my7pk
    @SandeepKumar-my7pk ปีที่แล้ว +1

    great work man!

  • @alsq110
    @alsq110 16 วันที่ผ่านมา +1

    I fell asleep and woke to this

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

    chris your videos is so much clear and smooth with no complicated code thank u from bottom of my heart my young brother learn from u and he ststed creating his dream game

  • @Mind--Blow
    @Mind--Blow ปีที่แล้ว

    hey Chris , i made it thanks for course!

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

    Chris, can you create a simple 3D game using three.js?

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

      it gonna be awesome

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

      Have you heard of 'Sougen'?

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

      @@shazam314 it's beatifull

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

      me too, hope Chris move to game 3D with threejs

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

      @@shazam314 sougen on deez balls?

  • @ucstudiotv
    @ucstudiotv 8 หลายเดือนก่อน

    Hi Chris, I used the platformer logic you taught us to create an adventure game, using panning and a camera box. however, the panning method you taught us seems very buggy. sometimes it works properly and the player can pan in all four directions north, south, east, and west. but sometimes the player doesn't pan at all. Can you help me to solve this problem? I would really appreciate it thank you.

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

    This is awesome....it would be great if it had more levels and other great features....I just dockerized it!

  • @joao.pinheiroa
    @joao.pinheiroa ปีที่แล้ว

    Really great tutorial!
    And I think this changes I made are a fix for 2 bugs at once:
    teleporting to the up platform and when falling fast go through it.
    I set a max gravity value (which even we irl have) of 7. So it stops accelerating. I added 3 to the hitbox height when cauculating if there was a collision in a platform, so it detects the collision a little before it occurs so it have more time to react, so the risk of the oine player frame beeing before and the other after the collision box is now gone. And added 1 to the platform collision box height just to make sure. And as the collision box of the player goes a little more down than the player, the 'teleportation' to the up platform when it shouldnt is also gone. :)
    There are any problems related to this solution?

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

    What tool do you use to draw arrows and lines on the screen when demonstrating and explaining?

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

    Your channel is heaven to me.

  • @azureharris8647
    @azureharris8647 9 หลายเดือนก่อน +2

    Hey so im following your content and was doing well up to 51 minutes with tiled. I downloaded Tiled and added the picture. but when I click export as, it doesnt give me the option to grab javascript files. Any suggestions ? I really wanted to complete this project

    • @SamiullahKhan
      @SamiullahKhan 26 วันที่ผ่านมา

      i already have no experience with tiled, so I skipped that part by copying collisionBlock and platformCollisionBlock array from data.js file in the linked repo file. I finished the tutorial that way. You can alway improve the process later

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

    Nice one Chris!

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

    amazing content! thanks

  • @Denis-di6hc
    @Denis-di6hc ปีที่แล้ว

    I downloaded this video cause this kind of brilliant shouldn't be lost

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

    Very nice tutorial! 🙏

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

    For the gravity/velocity issue, isn;t it better to just cap the max-speed ? Since that's also how RL works. You cannot build momentum indefinitely. And also you would not like the game visuals to move faster than intended.

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

    This is great! Thanks!

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

    Thanks, the tutorial you made was really helpful chris! by any chance do you plan to make a video tutorial on making a simulator game like stardew valley in the future?

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

    Hi Chris, i appreciate your tutorials, its possible to make a diagonal walk plataform ? like > " / ", move like sonic game.

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

    i love your ideas

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

    Thanks a lot for the video

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

    one other question was why loop in the gravity collision detection example? Couldn't you say, "If the bottom of the player would be below the bottom of the canvas, set their position to be at the bottom"?
    like if they were going to fall 1.5 pixels, but can't, fall the remaining amount then stop

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

    wow awesome,
    Thanks

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

    Thanks for the great content. 1 Que how much it take for u to create video this long?

  • @user-pi4hl3bu2o
    @user-pi4hl3bu2o 8 หลายเดือนก่อน

    chris is one of the best coder🤩🤩

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

    Thank you for this amazing tutorial!!!
    Is anyone have issues with the sprite onload part? Iv been stuck on it for days and cant figure out why the sprite isnt colliding after removing the declared width and height from the player class and using the onload function in the sprite class instead. Would appreciate any help and thank you!

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

    Sir, can you make a video or tell me which programming books you prefer to learn js as a beginner like me.

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

    I really want to buy your courses, but I can't listen to English well. So I'm really looking forward to this feature.
    I really hope you'll look into this.
    Thank you!

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

    Hi,
    Great work! what is the name of the app for the todo list? Thanks.

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

    Hi, i like your method to teach, thanks very much for what u doing. I have a question, why u use javascript not unity ??

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

    isn't it better to create the "collision blocks" in tiled using "Object Layers"?

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

    Hi Chris, great work! Will you continue this tutorial and will it be part of the premium section and uploaded on your website? Can't find the course there yet ;)

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

      Haven't decided just yet, have to finish off some of the other courses first like Pacman, Pokemon, and Fighting Game. But can definitely add it to the site if you'd like to view there instead, just let me know 🙏

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

      @@ChrisCourses Sounds Great! I would love to See this course also in your Website. I‘am currently doing the Space invaders tutorial and have just finished adding Sound effects 🔥👍🏻

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

      @@gflaap ok great! I'll upload those today for ya

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

      @@ChrisCourses Great, really appreciate. Best regards from Germany ✌🏼

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

    Really good course do you know of a way to make the pixel look crisp

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

    it looks so cool wowo

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

    When using requestAnimationFrame() we don't need use the delta time, since requiestAnimationFrame is based on the displlay refresh rate right? So there is not problems whith the game speed being different on a player at 60fps and other 144fps?

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

    When the guy is running to the left his legs are moving clockwise, backwards compared to the direction he is going. Looks like Michael Jackson moon walk :-) You probably need to iterate the animation images in reversed order for this case. Great quality tutorial, BTW. Thanks.

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

    Drawing a rectangle over all existing canvas drawing is not the advised way of clearing. You want to use "context.clearRect" method

  • @coreyrobertmalone4590
    @coreyrobertmalone4590 5 หลายเดือนก่อน

    Hi Chris. I love your videos. I got to 2:30 : 55 and my guy teleports up ontop of the red ledge instead of stopping at the red collision blocks at the left of the screen. Any ideas why that might happen ?

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

    thank you bro

  • @onurgul3689
    @onurgul3689 6 หลายเดือนก่อน

    Its nice but the map is limited and everytime the blocks are in the same position how i can change it ?
    I want to create endless map to the up and blocks randomly located

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

    Hello, just finished coding this and it worked. I was wondering if you could do a Yugioh type game next

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

    What does the code look like for the Screen moving up or down in relation to the character (main Object),So when the Character falls,the background moves up And when the Character moves /jumps up the Background moves down

  • @enmanuelcolina4203
    @enmanuelcolina4203 10 หลายเดือนก่อน

    hola, se supone que camera es como todo la vision del mapa, mientra sque camerabox es la de vision del jugador? se puede entender asi?

  • @Ketchup911
    @Ketchup911 4 หลายเดือนก่อน +1

    How does he draw the diagrams on screen ?

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

    i have a problem: x postion change going smooth, but y changed abruptly, it just teleport player when jump, for example

  • @EduardKaresli
    @EduardKaresli 6 หลายเดือนก่อน

    Hi Chris, very nice work, but I am curious, have you managed to monitize your web games in any way?
    Are web games still a feasible business in 2023?

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

    Amazing :D

  • @Pyhia
    @Pyhia 3 วันที่ผ่านมา

    Again I wake up to this

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

    nice tutorial ! maybe it would be better to use State pattern for Sprite Swapping ?

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

    Great work chris! Would you consider doing a super auto pets clone? Much love :)

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

    Hi Chris,how do you make money through game development,and is javascript great for that tacks because most people don't play game online anymore

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

    Just a small question: why didn't u use event emitter(subscription) model but all the time add different action to the different part of script(just a newcomer in web games that's why asking for)?

    • @SamiullahKhan
      @SamiullahKhan 26 วันที่ผ่านมา

      i think the author went with the simplicity, thought a lot of things could be improved

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

    Díky!

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

    HI, I have a question I'm just curious. Let's say you make a game or an app and you have people play it online. Since anyone can see your JS code in the webbrowser as well as HTML and CSS, how do you know they won't copy/steal it and make a copy of your app/game?

  • @learningXode-NG
    @learningXode-NG ปีที่แล้ว

    Nice One !

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

    Amazing...

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

    when you said you like using sublime text, I had to check when this video was uploaded.

  • @marcelo.victor
    @marcelo.victor ปีที่แล้ว

    If his videos are this level quality, i wonder his course...

  • @samuelardelean7037
    @samuelardelean7037 7 หลายเดือนก่อน

    Hi Chris! You are amazing! I followed your Game Courses and they fill me with joy. Thank you for the game assets and incredible explanations.
    I wanted to add something to the project, I wanted to start first with the "Attack" feature so I tried to add a new event for the key "X" to switch animation, but in the game assets there are 3 animations for attack and they load too fast or too slow. anyway I know something I am doing is wrong. Can some help me fix this issues?
    [keydown event]
    switch(event.key) {
    ....
    case 'x': keys.x.pressed = true; break;
    .....
    }
    animations: {
    .....
    Attack: {
    imageSrc: './img/warrior/Attack1.png',
    frameRate: 4,
    frameBuffer: 3
    },
    ......
    };
    if (keys.x.pressed) {
    player.switchSprite('Attack');
    } else {
    player.switchSprite('Idle');
    }

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

    Hey Chris , can i ask u why u don't use three js instead ?

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

    [1:06:51]
    So for some reason, when I add the console.log command to my index.js file, it will not log out the array. It works fine if I put the console log in the collisions.js file. So I know the collisions file is linked properly to the html file, but for some reason the index.js file cannot access it. Any thoughts?

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

      Nm. Figured it out. I had put the collisions.js script link in AFTER the index.js link in the HTML file.

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

      Yeah a common problem when ordering files. This is solved using modules in JavaScript, but that’s a whole mother topic for learning. The Mario course shows it off quite well 👌

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

    Why don't you just flip you spring using CTX.transform, instead of using another sprite?

  • @quochoangang6014
    @quochoangang6014 11 หลายเดือนก่อน

    Hi Chris! Can you make the PixiJS Game dev tutorial???

  • @anth0ni33
    @anth0ni33 3 หลายเดือนก่อน

    I LOVE THIS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

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

    doubt : Sir you didn't used the semicolon ( ; ) on any line . Please tell me if any one it would be helpful

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

      semi colon is optional in javascript, even if you don't add it, it won't cause any issues most of the time

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

    Useful timestamps:
    15:00 - how to edit/update your gaming website

  • @yamen_727
    @yamen_727 4 หลายเดือนก่อน

    ياخي ليش مافي ابداع عربي مثل هذا الأخ 😢😢😢😢😢😢

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

    Those transitions haha, teach me

  • @Zer-qs3du
    @Zer-qs3du 10 หลายเดือนก่อน

    @ChrisCourses Hey Chris, I followed all your code but I am having issue with the 'getContext' part. I tried searching the web and followed the instruction but it is still not working and giving me error message "Uncaught TypeError: Cannot read properties of null (reading 'getContext')." If you could tell me how to fix this issue then it would be awesome! Thanks in advance!

    • @SamiullahKhan
      @SamiullahKhan 26 วันที่ผ่านมา

      The canvas element is undefined in your case.

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

    Can Hostinger host nodejs web sites? I write games that use nodejs and code running in nodejs for saving game data.

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

    If you skip the domain part of this, can it still work, and if I make my own website, can I use these same steps to put it onto my own website?

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

      Indeed, you can still use the same code on any hosting provider

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

      @@ChrisCourses okay thanks

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

    Is it possible to create a hitbox by simply deleting all transparent pixels on the frame?

    • @SamiullahKhan
      @SamiullahKhan 26 วันที่ผ่านมา

      Initially I also thought like that, why we are going all the effort of trial and error. May be it's a standard practice as every sprite will have those margins. but i am curios to know

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

    1 doubt....plz help me solve that
    Hello Sir,
    I hope u r having a good day :)
    Actually i m having a doubt in javscript which i want to clarify...
    i m trying to make a javascript game in which i am having a player a projectile array and an enemy array
    i m having a 'gameFrame' variable with initial value 0 and a value of '1' is incremented to it at eveny frame of the game
    it basically calculates the number of frames of the game
    i m having an animate function which calls itself again and again (recursion) by requestAnimationFrame() inbuilt function
    of javascript....
    now i want to generate a enemy every 10 frames for that i write this code :
    function enemy(){
    if(gameFrame % 100 ==00) enemeies.push(new Enemy());
    for(let i = 0;i

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

      for(let i = 0;i

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

      @@nein9420 no no thats typing mistake i ve done these but.....no improvement