DEV Community

Cover image for Make your computer move from A to B in javaScript (Whilst also avoiding walls!)
Ania Kubow
Ania Kubow

Posted on • Updated on

 

Make your computer move from A to B in javaScript (Whilst also avoiding walls!)

This tutorial is useful for so many games, but I am going to show you how to do this using PacMan as an example. For those of you who watched my PacMan Game Walkthrough, you will know that in the game all the ghosts have random movements. They do not really 'chase' PacMan around the board. Hopefully, after watching this video, you will be able to implement some smart ghost movement logic into your game, resulting in each ghost chasing PacMan.

Watch the video here > https://youtu.be/Rr2xCoOm5BM

I would love to see what you made so please tag me on twitter on @ania_kubow or mention me on Youtube so I can find it and see :)

Top comments (0)

An Animated Guide to Node.js Event Loop

Node.js doesnโ€™t stop from running other operations because of Libuv, a C++ library responsible for the event loop and asynchronously handling tasks such as network requests, DNS resolution, file system operations, data encryption, etc.

What happens under the hood when Node.js works on tasks such as database queries? We will explore it by following this piece of code step by step.