Multi-room Platformer Game Tutorial with JavaScript and HTML Canvas

Multi-room Platformer Game Tutorial with JavaScript and HTML Canvas

Chris Courses

1 год назад

227,556 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

OohSorry
OohSorry - 27.10.2023 21:43

BRO U ARE SOO SMARTT

Ответить
Code with Yesworld
Code with Yesworld - 22.10.2023 15:24

Thank you for the Tutorials!

Ответить
Bailey Eri Kadosh
Bailey Eri Kadosh - 14.10.2023 03:25

I have a question, is Javascript and HTML canvas good for large scale indie games?

Ответить
Alstier
Alstier - 08.10.2023 07:47

Thank you for the video it's informative for someone like me who is basically a beginner! Very clear and easy to understand I like the step by step!

Ответить
JlnTrog
JlnTrog - 29.08.2023 03:13

First thanks a lot for all those tutorials thay help me a lot !

I just pointed an issue about player movement when we press multiple keys at the same time.
Press RIGHT then LEFT then release LEFT lets you go right then left then right, no problems it works.
Press LEFT then RIGHT, player keeps going to the left not reacting to the second press.

To solve this issue I did 2 things :
- In the event listeners, I toggle keys.X.pressed only if (!event.repeat).
- In index.js I put a variable called lastDir. It's set to 'none' by default when player is not moving, to 'left' if only LEFT is pressed, to 'right' only if RIGHT is pressed. Then before checking if a sole key is pressed I check if both LEFT and RIGHT are pressed. If so I make player go the opposite direction told my lastDir + I don't update lastDir.

Don't really know why it works but it does 😅

Ответить
DG
DG - 12.08.2023 06:16

I can't get oncomplete in gsap to stop looping. Any suggestions?

Ответить
Feeling Like
Feeling Like - 02.08.2023 04:50

anyone else having issues with the onComplete method ??
This is some awesome tutorials and I love learning from you. but I hit some roadblocks every now and then xD


Edit: nevermind xD i figured it out

Ответить
Ertuğrul Ahmet TEMEL
Ertuğrul Ahmet TEMEL - 26.07.2023 16:02

Here's a little css to enhance the graphics a little bit:
canvas {
image-rendering: pixelated;
}

You can also want to center the game:
body {
background: black;
margin: 0;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
}

Ответить
CurrentPiano
CurrentPiano - 19.07.2023 06:57

it broke when i added player.js

Ответить
Sebastián Bruno Bautes
Sebastián Bruno Bautes - 12.07.2023 18:31

you can make a walkthrough of platform game, NES style games, lode runner, nuts and milk, wrecking crew, etc. Where the game scenario is built dynamically by blocks

Ответить
Sebastián Bruno Bautes
Sebastián Bruno Bautes - 12.07.2023 03:25

hey man you should create a game engine in javascript, good job!!

Ответить
Ricardo Colon
Ricardo Colon - 10.07.2023 05:08

Great tutorial, I have few questions, how can multiple doors be applied into one level? and if I go to a previous level how can I spawn into a new position instead of the same position it was before in that level?

Ответить
Vach Nersesyan
Vach Nersesyan - 04.07.2023 19:18

GOD bless you

Ответить
Akrit G
Akrit G - 24.06.2023 16:33

Where do you get the soundtrack and sound effects from?

Ответить
Diego W.
Diego W. - 23.06.2023 17:17

Really appreciate your job here man. Could you be so kind in telling me the difference between coding this in JS and in Python Py game? Doing so, are both possible to create an .exe file to start the game or it would only run on a browser? Thank you and I wish you much success! Regards from Italy.

Ответить
Dante Deluca
Dante Deluca - 23.06.2023 11:07

This is one of the best tutorials i've ever seen.

Ответить
Give Academy
Give Academy - 27.05.2023 22:15

Not hating… just curious…
Why go through all the extra work to convert the collisions data into a 2d array? 2D Position in 1D array is y*width+x. I also wonder why it is necessary to create all of these collisionBlock objects? It seems 2 methods drawCollisionBlocks (would allow rendering the red boxes where they should be for debugging) and a quick lookup in the collision data to see if the value at the position of the current sprite location is 292 or not, would have taken much less work and created less overhead… so I’m curious as to weather this was necessary and why? Or what benefits come with doing it this way? My guess is that it is a style choice?

Ответить
João César Lima
João César Lima - 23.05.2023 20:19

Another amazing tutorial! Your pace and clarity are just incredible. Your latest videos totally deserve more views!

Ответить
TProduction
TProduction - 20.05.2023 10:15

THIS IS THE MOST USEFUL VIDEO I SEEN

Ответить
snowflake
snowflake - 18.04.2023 09:05

You are a miracle.

Ответить