I have no idea of much programming but I could understand almost everything. Your teaching is amazing!!!
@henrikstorch4275
7 жыл бұрын
This is actually pretty interesting and cool! Can you please make some more refactoring code? ^^
@xetop
7 жыл бұрын
I think it would be a good idea just to pass in a type, lane number, and number of obstacles. Odd / Even lane index = positive or negative speed. Number of obstacles, fewer = bigger obstacles, more obstacles = smaller obstacles Spacing based on number of obstacles. In a loop through indexes: Type based on index, index 0 & max_index = safe zone, and max_index / 2 = safe zone. max_index / 2 could also indicate the switch from car lane to log lane.
@xetop
7 жыл бұрын
Anyways, good videos, I've watched a lot of them the past couple of days, interesting stuff, and very entertaining :) I've learned a lot.
@TheCodingTrain
7 жыл бұрын
Great suggestions!
@Kitulous
6 жыл бұрын
Dan's implementation is a lot more flexible, but your implementation is more suitable for this concrete idea of a game.
@niels9947
7 жыл бұрын
This is so cool to watch. I love to see a challange of my favorite C64 game * Boulderdash *.
@sreejithpro
7 жыл бұрын
Interesting thing about your videos is that when you advance through coding challenges, you will reach a stage where you will catch the error you are making before you catch it by running and that makes me happy :)
@tomburris8380
7 жыл бұрын
I'm interested in seeing you do this again in JavaScript! :)
@joostvanrens
7 жыл бұрын
I would have first decided the number of lanes (11 in this case) you need. Based on that number and the window size you can calculate "grid". That way if you change the window size or add a lane, the whole thing scales automatically. grid = height/lanes.length; Anyway, thanks for the videos, Dan.
@TheCodingTrain
7 жыл бұрын
Good tip!
@gqoniefh
7 жыл бұрын
PRO grammers are sure to think through these things much faster/efficiently because of their experience but I bet zero of them think your an idiot....Your videos are attractive to me because I know nearly nothing about coding languages and really seems like (in my 45 year old age) I can absorb and learn along with YOU perfectly.
@gqoniefh
7 жыл бұрын
I can't help but think as I learn more through you I would want to pause the video and code ahead of you....then verify how I progressed :)
@ricardolima5206
7 жыл бұрын
I haven't watched the whole video yet, but I strongly feel that when the frog jumps on a log, or out of a log, its x position should be corrected, so it wont be out of the grid. Great video, love the channel :)
@marksherriff2206
6 жыл бұрын
Hi Dan! As always thanks for this video series. I thought it might be useful to have the frog 'snap' back to the grid when hopping off the logs, but I don't have Github so I'll share it here - it's a function to go in the Frog object, called on a move (best place I could find for it) : void snap() { float a = grid - (frog.x % grid); float b = frog.x % grid; if (a < b) { frog.x += a; } else if (a > b) { frog.x -= b; } else if (a == b) { if (random(1) > 0.5) { frog.x += a; } else { frog.x -= b; } } } It just uses the frog's x position and some modulus operations to find out which 'cell' it should fit into, i.e. if it's between two 'cells', it finds the relative distances and snaps to the correct one by setting the frog's x equal to the cells (by adding or subtracting the /other/ distance).
@TheCodingTrain
6 жыл бұрын
Thanks for the tip!
@PhilBoswell
7 жыл бұрын
An alternative, and possibly more flexible, way to check which Lane the Frog is currently occupying would be to check whether they intersect. That way you could have lanes which vary in width and not have to include complicated arithmetic in the Frog code.
@TheCodingTrain
7 жыл бұрын
Thanks for the tip!
@JBFFSK18
7 жыл бұрын
a chalenge in p5 would be great :D
@midnightrizer
5 жыл бұрын
it is kind of ironic the computer you use to remake the game is a zillion times faster and bigger memory wise and graphically its a zillion times in reverse of the 8 bit original :) but it really makes you appreciate how much they got done with 8 bits and practically no sound ya?
@asston712
5 жыл бұрын
The coding train is all about making the program then refactoring it in a separate video.
@johnarinehart
7 жыл бұрын
MOAR REFACTORING!
@FoxSurvival
7 жыл бұрын
Thanks for the video :) might it be an idea to read the setup values from a file? You could then have different level files which configure the program. (p.s watched until the end!)
@TheCodingTrain
7 жыл бұрын
Oh, love this idea!
@hdndhdbxhhfbxgdggdbxhdb1984
7 жыл бұрын
ps time is 15 min. ive learned how to code from you thanks!
@sreekara_mouli_tadinada
7 жыл бұрын
yep...was waiting for this
@jesus650rwc
7 жыл бұрын
I've got a challenge for you, how about a 3d fracturing object? When it falls, it breaks into pieces and depending on the impact, it breaks dynamically (:
@sinom
5 жыл бұрын
"and actually, I don't need to have this argument here" sounds like something a married couple that doesn't get along really well would say.
@DreamhopMusic
7 жыл бұрын
interesting =)
@dave6012
2 жыл бұрын
Refactoring to javascript would basically be a search and replace 😅
@camelcase9225
7 жыл бұрын
I like that sunset animation at the end. Is that perlin noise for the terrain?
@TheCodingTrain
7 жыл бұрын
Indeed!
@CharIie83
6 жыл бұрын
great
@TheCoolSquare
7 жыл бұрын
I've got a question about the frameworks you're using. I'm brand new to your channel and just now finding out about P5 and Processing. My question is why don't you use any access level modifiers in your java code? Like public, private, etc. Also i found it weird that you were able to access the "constants" you defined for lane types in the lane class when you defined them in the main file. Are these just changes to the language that Processing makes or is it some sort of option I don't understand?
@joelpaley9912
3 жыл бұрын
yeah I'm also curious about this ^
@TheCoolSquare
3 жыл бұрын
@@joelpaley9912 it looks like I was just being dumb three years ago and that this is JavaScript, not Java.
@joelpaley9912
3 жыл бұрын
@@TheCoolSquare oh yeah good point lmao. Also props for answering to a reply to a comment you made 3 years ago
@Damixx111
7 жыл бұрын
Really great and entertaining video! But I would definitely use an enum for the type instead of the strings tho, much better readable and logically better understandable imho :)
@TheCodingTrain
7 жыл бұрын
It's a great point, thank you!
@JoshuaShope
7 жыл бұрын
You should do more Python3 Coding challenges
@chasestevens9481
Жыл бұрын
how would you add images and make it work with a Arduino joystick?
@ahmadfadillah4243
7 жыл бұрын
master
@whatsup7341
7 жыл бұрын
Hi Daniel, in p5.js is it possible to check object (or model?) intersection with complex .obj files made in sculptris? Or to do an alternative, maybe hitboxes but for intersection?
@ShaunHusain
7 жыл бұрын
Not sure about a 3d intersect function but using box based intersection almost always simplifies things. Either that or project from viewpoint and intersect the images to see if there is overlap possibly but cube intersection will be faster since only a few values need to be compared per object (6 constraining planes defined by 1 value each).
@MrIksior
7 жыл бұрын
awesome...
@Ikpoppy
6 жыл бұрын
INTRESTED
@aladaris
7 жыл бұрын
Do you even Enum?
@AROD-oh5ez
5 жыл бұрын
i was thinking this the entire time lol
@mokeecomputer5751
7 жыл бұрын
When typing the lanes, why would you not use an enum rather than a String??
@TheCodingTrain
7 жыл бұрын
I avoided enum just to be more beginner friendly, but yes it would make sense here!
@bellabarry5452
7 жыл бұрын
do you code c# if so you should try and make the first Mario level in c#
@julianandrescardenaduarte7172
6 жыл бұрын
Excellent game, but the interface its a little basic dont you think? How can we do for putting images in order to the game sees more pro.
@brunomello7499
7 жыл бұрын
Let's say I'm trying to make a similar version of this game using JavaFx library. How could I set up a setup and a draw function just like processing have?
@renx99
5 жыл бұрын
I watched till the end :)
@RosBoss1337
7 жыл бұрын
You should try to create winlines
@artiifex1795
7 жыл бұрын
Please try to code the game "curve fever", I am really interested in how you would do it. Greetings from Austria!
@shilangyu
7 жыл бұрын
JavaScript version please! would love it awesome video :)
@ShaunHusain
7 жыл бұрын
K4kshi code has already been ported to js I ported it from there to c++
@shilangyu
7 жыл бұрын
He asked if we want a refactoring continued in js
@shilangyu
7 жыл бұрын
Also, where could I find your c++ code?
@ShaunHusain
7 жыл бұрын
ah gotcha I just started the vid github.com/shusain/FroggerOLED. I put a short video of playing it on my channel too if you search coding train on GitHub you can look through their repositories there's the frogger js one I used there as a starting point... didn't fork since I was doing a copy to make it work on a photon particle.io board (like a powerful Arduino with built in wifi)
@shilangyu
7 жыл бұрын
awesome, thanks :)
@coffeecatrailway
7 жыл бұрын
When i use P3D for any project it takes a few minutes to load can i speed it up?
@jonishandro2795
7 жыл бұрын
How can i replace the rectangles with car photos?
@Volvix127
7 жыл бұрын
I wish you code python
@BlazertronGames
7 жыл бұрын
Hey dan, I think I might have commented this on another video. But how difficult would it be to make this in pure JS, without any frameworks? EDIT: Just realised this wasn't in p5.js. But either way, how hard would it be?
@TheCodingTrain
7 жыл бұрын
Wouldn't be too tough, p5 simplifies all the drawing and animation stuff but otherwise it's the same!
@edwincruz9896
5 жыл бұрын
Is this C++?
@hdndhdbxhhfbxgdggdbxhdb1984
7 жыл бұрын
one more thing. where did you get java/javascript?
@MiguelOrtegaFloress
7 жыл бұрын
hola bro, que lenguaje de programación es ese?
@nt_visuals2471
7 жыл бұрын
Do you do LUA 5.2 tutorials?
@hdndhdbxhhfbxgdggdbxhdb1984
7 жыл бұрын
Code Challenge: Create a search engine that you can play a game when offline (Any Game)
@jasonjawerski979
7 жыл бұрын
Space Impact pls :)
@user-po1kd7fs6c
7 жыл бұрын
Cool :"D
@user-po1kd7fs6c
7 жыл бұрын
Thanh Nhan Nguyen Dont know wtf:D It was about 6 days ago :D
@ShaunHusain
7 жыл бұрын
Иван Каратаев might be early release for patreon supporters?
@user-po1kd7fs6c
7 жыл бұрын
Shaun Husain mb, this video was "по ссылке", pls use translate :D
@lookitsanivysaur.3172
7 жыл бұрын
Can someone tell me what software he is using?
@TheCodingTrain
7 жыл бұрын
This is processing.org
@TomaszBDG
5 жыл бұрын
Source code doesnt work :(
@staticvoidsolutions4998
5 жыл бұрын
source code for this challenge link is broken: github.com/CodingTrain/Rainbo... --> 404
TheFireBroz // TFB he's typing the while video copy and pasting wont help you learn reading and writing will
@TheFireBrozTFB
7 жыл бұрын
umm, the video was private, i was just telling him to make it public
@Kitulous
6 жыл бұрын
TheFireBroz // TFB oh, you should be more specific then, because when I first read the comment, I thought about publishing the code, not the video, too.
@MaxPicAxe
7 жыл бұрын
Please *refactor this once more* to make *CarLane, SafetyLane* etc. which inherit *Lane*. Then also *stop inheriting Rectangle* and make that *this.rect* EDIT: Please redo the coding challenge in javascript with the above changes. Thank you!
@TheCodingTrain
7 жыл бұрын
Great points!
@cabbler
7 жыл бұрын
haha I am not a personal fan of the messy coding start. think beforehand about the most efficient structure to use. Here it really bugs me how rigid the Lane type system is
@marcogannetti1592
7 жыл бұрын
WE WANT MACHINE LEARNING AND AI! STOP WITH FROG! :P
Пікірлер: 98