stardance has been extended another month! the new deadline is october 31 :)

You are browsing as a guest. Sign up (or log in) to start making projects!

6h 4m 8s logged

JavaScript Port

After finishing Pineapple Chess in Java, which meant you need to download my app, which is Windows only, I started getting a lot of people asking if I could port this to the web. So I did, yay.

From Java to JavaScript

The original version of Pineapple Chess was built entirely in Java, and after finishing it, I figured porting it to JavaScript would be a pretty interesting challenge. The reason why I have to use JavaScript for anyone curious is because that is one of the best for web development.

The goal was to recreate the game in JavaScript while keeping the same basic gameplay and features from the original version. This meant going through the original code and rebuilding a lot of the game’s logic in a completely different language.

Rebuilding the Game

One of the biggest parts of the process was getting the chess logic working again. I had to recreate things like:

  • Piece movement
  • Check and checkmate
  • Special chess moves
  • Turn switching
  • Selecting and moving pieces
  • Detecting when the game ends

Since I already had the Java version working, I wasn’t starting completely from scratch. I could use the original game as a reference for how everything was supposed to work, which made the process a lot easier.

Why JavaScript?

The main reason for making the JavaScript version was accessibility. The original Java version worked, but having a JavaScript version makes it much easier to run and share.

Instead of needing to set up the Java version first, the JavaScript version can be used in a much more web-friendly environment.

Basically, Pineapple Chess is now significantly easier to get running.

And That’s a Wrap!

This is actually going to be my last devlog for this event. With the event ending in about two weeks, I wanted to squeeze in one last piece of work before it wraps up, and porting Pineapple Chess to JavaScript felt like the perfect way to finish things off. I know this devlog isn’t much of a change, and there are a lot of features in Pineapple Chess that I would love to add, it’s just I don’t have the time as I have a lot of work in school, and Stardance is ending soon, I will be working on this in the future though.

It’s pretty cool seeing a project that I originally made in Java now running in JavaScript. The original version isn’t going anywhere, but now Pineapple Chess has a new form too. I will be shipping this soon, stay tuned!

And also, thank you to everyone who followed along with my devlogs, gave feedback, played Pineapple Chess, or suggested things for me to work on. All of the feedback and support throughout the event has genuinely been really helpful and made working on this project a lot more fun.

It’s been awesome being able to work on Pineapple Chess throughout this event, it’s not a big project like what other people make but it was a passion project for me for fun.

One last update before the event ends. 🍍❤️

Thanks for reading, and I’ll see you around the next Hack Club event!

0
12

Comments 0

No comments yet. Be the first!