Today I wanted to make something cool, you know, like those fancy slides some people do, but I’m not good at design, at all. So I thought, why not make something that can fight? That’s how I got the idea to make “combat slides”.
First, I started by setting up a basic webpage. Just a simple HTML file, nothing fancy. Then I added some slides, just plain divs with different background colors to tell them apart. I made sure they could move using some basic JavaScript and CSS transitions. That was the easy part.

Next, I wanted to make these slides “fight”. I thought, let’s give each slide some “health” and “attack” power. I did this by adding some data attributes to each slide element. Then I wrote some more JavaScript to make them move towards each other. When they “collide”, they’d exchange “attacks”, simply reducing each other’s health.
Here’s a breakdown of the steps I took:
- Created a basic HTML structure.
- Added multiple div elements to represent the slides.
- Used CSS to style the slides and make them look distinct.
- Added JavaScript to enable movement with transitions.
- Assigned “health” and “attack” values to each slide using data attributes.
- Wrote functions to handle movement and “combat” logic.
- Implemented a simple collision detection.
- Updated health values based on the attacks and removed slides when their health reached zero.
- Added some visual effects to make the combat more appealing.
It was pretty fun to see the slides move and “fight” each other. I added some basic animations when they attacked, like shaking a little or flashing. I also made it so that when a slide’s health reaches zero, it fades out and disappears. That way, you can clearly see who’s winning.
After messing around with it for a while, I decided to add some more features. I thought, what if you could control one of the slides? So I added some event listeners for keyboard inputs. Now, you can move one of the slides with the arrow keys and make it attack with the space bar. It felt like a mini-game at this point!
Adding Some Spice
To make it even more interesting, I added a feature where slides could “level up”. Every time a slide wins a fight, it gains some experience. When it gets enough experience, it levels up, increasing its health and attack power. This made the fights more dynamic and unpredictable.
I also added a simple scoring system. Each time a slide you control wins, you get points. This added a bit of a competitive element, trying to beat your own high score. It’s nothing too complex, just a fun little addition.
In the end, it turned out to be a pretty neat project. It’s not the most polished thing in the world, but it was a fun way to kill some time and learn a few things along the way. I never thought I’d be making “combat slides”, but here we are. It’s a good reminder that you can make something interesting out of the simplest ideas. Sometimes, all it takes is a little bit of creativity and a whole lot of messing around.