19- Making HTML5 Game: Maps and Bullets Collision. Javascript Tutorial Guide

preview_player
Показать описание
Episode 19 about making a video game in HTML5. In this video, we revamp the map system and we handle bullet collisions.

If you have any question, feel free to post a comment below or send me a Youtube PM.

Рекомендации по теме
Комментарии
Автор

Hey man! I've been trying to make bullets look different for player and enemies, but it seems to never work.
What I did is load images in Img.bulletPlayer and Img.bulletEnemy and then change the Img.bullet to img in

Bullet= function(id, x, y, spdX, spdY, width, height, combatType){

var self = Entity('bullet', id, x, y, spdX, spdY, width, height, img);

Then, in generateBullet= function(actor, overwriteAngle)

after declaring var combatType=actor.type;
I've put
if(combatType === 'player'){
var img = Img.bulletPlayer;}
else if(combatType === 'enemy'){
var img = Img.bulletEnemy;}

adding img attribute when calling Bullet
Bullet (id, x, y, spdX, spdY, width, height, combatType, img);

It just says Uncaught ReferenceError: img is not defined. :(
Thank you for the great tutorials! :D

vladandreidinca
Автор

at 4.45 when you are changing the WIDTH and HEIGHT in Entities.js to the currentMap.width/height, my browser is saying that currentMap is not defined... how do i fix this??

joelgiovinazzo
Автор

Hey - The educational approach is great, but there is no way to "get it" unless you go back and re-create the game yourself without the tutorials babysitting you. I have created this game about 20 times, and especially with the OOP it is important for me to really internalize the "pattern approach". I don't think it is something that can be entirely taught, for me anyway. RC is like a coach, and I have to somehow take it onboard, which is not something he can do for me. The difficulty with a tutorial of this depth is that when I do actually write the program myself, up to the point where I left RC, then, when I want to go back, I have deviated from the strict examples in his code, and the farther I progress, it is harder and harder to re-mesh with him when I am ready to go to the next level of what he wants to teach me. That isn't RC's problem though, it is mine. These are the best overall programming tutorials I have even worked with. Thanks!!

dragnetmarketing
Автор

What if I want to have only one map, and i want that player moves, not map?

bytnior
Автор

Rc when you are going to post the next step, im your no. Student looking forward for character movement and behavior

jcboy
Автор

Just an FYI, the fact you keep overhauling your codebase inbetween videos makes it impossible to follow. Every time you start a new episode you go back and forth from using super_update(); to drawing the bullet/enemy within the function and as a result my entire code breaks and i have to start back over again

JasonBoyce
Автор

Great Tutorials, but RC has a bad habit of modifying the code between tutorials and not updating the viewer. This tutorial has a severe case of that with the generateBullets. In a prior episode in Object Orienting he had the viewer move code from the update function to the bullet object. In this tutorial part of it is magically returned to the update function.

Tygari
visit shbcf.ru