
Coding Challenge #32.1: Agar.io – Part 1 (Basic Game Mechanics)
The Coding Train
Views: 297313
Like: 4510
In this coding challenge, I create a clone of the multiplayer online game Agar.io using JavaScript (p5.js). This is only the beginning of this challenge where I build out the basic game mechanics. I plan to make a follow-up to this video and add the multiplayer functionality of the game using node.js and websockets.
💻Challenge Webpage:
🎥Part II:
🚂Website:
💡Github:
💖Membership:
🛒Store:
📚Books:
🖋️Twitter:
Links discussed in this video:
🔗Agar.io:
🎥Coding Challenges:
🎥Intro to Programming:
🔗 p5.js:
🔗 Processing:
📄 Code of Conduct:
🌐Help us caption and translate:
🚩Suggest Topics:
👾Share your contribution:
25.05.2022
Just a minor optimisation: you never need to use pi to scale up the blob's radius. Consider,
new_area = pi * new_radius^2 = pi * old_radius^2 + pi * other_radius^2
Divide everything by pi and take the square root to get:
new_radius = sqrt( old_radius^2 + other_radius^2 )
And thus we have a formula for the new radius with no pi's involved.
I have 1 problem.
Everytime I try to execute it I get "blob.show is not a function"
How do I fix this?
This is kinda like pasty planet!
These videos just makes me happy. Its so awesome to take part of your energy and passion.
Thank you!
Awesome vid, but I'm curious.. What do you need to change to make this playable over the internet? Agario has thousands of players? It is perfectly realistic. Are TCP heartbeat updates really fast enough for a totally real-time gaming experience. – Not in a home LAN. There is no UDP ability from browsers. I have access to a Godaddy pro dedicated server, non VPN. I have lots of experience coding Java authoritative RTS servers How does agario do it? Thanks
when i do
function Blob(x, y, r) {
I cant run it and it says syntax error, maybe missing a semicolon?
Please help
Very interesting and great videos. makes coding fun again, but the code doesn't work at all… its one error after another.. maybe show us how to set up the environment?
Make a T1000 simulator. Near the end of Terminator 2 when the T1000 gets frozen and blown apart, all the little blobs of liquid metal steered toward the nearest other blob, melded together, and repeated until there was only one main blob.
Then, for fun, you could make it explode again with a mouse click.
very very good, please speak game lightbot, rs
The blob speed smoothness is actually an side artifact of ping.
do paper io 2
thanks for bots 😉
Why does the main blob 'judder' when the mouse is held still?
How he writes so fast? Omg
where do i find the libraries? thanks!
see through sweat band!!
It says:
Uncaught TypeError: Cannot read property 'show' of undefined (sketch: line 34).
Line 34 says blobs[i].show.
What am I doing wrong?
did you no blobs.forEach(function(value){});
laughs at 21:34?
If you look closely you can see that shiffman has a slice in his forehead
I searched in the reference and this splice function was remove, what can I do to have the same effect?
Please tell me how to make PAPER.İO. please please.
you forgot to do the mouse thing where the thurther your mouse is from the circle it moves quicker.
I’m so disappointed in myself for not continuing to program. I started on Khan Academy when I was literally 9 and I was making simple games and animations but I just stopped doing it and now I’m almost 14 and I just wish I stuck with it. I’m gonna start coding again.
11:00 ?
can u make me a custom agario?
.show isn’t working for me can somebody help me
Sir when I entered blob.show it is coming blob.show is not a function
Sir it was coming the numbers added are not enough for sequence
Привет я подсяду?
How much do the square root calculations slow this down?
Is this p5, or proccessing?
function setup() {
this.NoInternet = whycantiwatchthisvideo?
}
it doesnt work
everything = Daniel Shiffman + p5.js;
Hi can you make a game like tik tac toe, chess , pinball etc., please
Or some great 2 player games
The codes don't work, show HTML 😞
Love what you do, I also try to explain complex ideas in beginner language on my channel, I would appreciate your support https://www.youtube.com/channel/UC6N4i972Z7F-ozmUWDakS1Q
I am a fan of your work, I also try to explain complex ideas in beginner language on my channel, I would appreciate your support https://www.youtube.com/channel/UC6N4i972Z7F-ozmUWDakS1Q
this wont work
I didnt know that a brazilian coded it! Im so proud
Im so happy. To be an aspiring coder ( i suck and currently failing my courses but still want to try)
Do you do tutorials your fun to watch and make things simple, i wish school was fun but we code in java and VB .net framework, it is such a snooze.
It's been 3 seconds and I already fucking love this guy
nice bro thanks
do you have understandings in android and apk's (applications)
Are you gey 😪!?
Thanks for your great tutorials!
Why do I het a «ReferenceError: createVector is not defined» at 2:47. I'm working with the p5JS-Editor
What. You mean "Blobject"
2:05 saved