PS/2 Bar code Scanner using an Arduino

From the acclaimed series: Stuff that I do when I’m bored.

A few months back, I was doing a simple Market-Management system for a School Project and I had this old PS/2 Bar code Scanner that I wanted to use in it but I had no PS/2 to USB converter. So then I got this idea to make one ‘on my own’ using my Arduino. I’m not expert in electronics, and I don’t understand much how this things work, but I did some research on and with a help of a few tutorials I managed to make this thing finally work and I will post how everything is working at the moment.

The main wiring can be done following this tutorial, I used a breadboard to make things more organized. The color code got me a little bit confused, It problably was made following a weird rule, but in my case I used the Red wire for the 5V, Blue wire for the Clock, Green wire for the Data and the Brown for ground. It ended up looking like this:

wiredThe LED was scrapped of from the code, but this is the most recent picture that I have.

The code was mainly taken from Benjamin Maus because this is my first time dealing with PS/2 stuff and I didn’t know how everything worked. I added support for letters and a few symbols in the code and deleted some stuff so I can use for my next project. You can check the final code here

Know bugs: A letter J is added to the front of the Bar code after the first time its used.
A few links that were very useful when making this:
http://www.computer-engineering.org/ps2keyboard/scancodes2.html
http://playground.arduino.cc/ComponentLib/BarcodeScanner
http://www.computer-engineering.org/ps2protocol/

 

Sight System

After a few months of no updates (mostly because of the classes that I’m taking), I’m finally getting back to making my 2D game.

I thought a lot about the light system that I presented a few posts ago, and I decided that I was not going to use it anymore, well, at least not for now. I’m going to make the “You can see everything in front of you and everything else will be blacked-out” style. I found this very interesting, more simple and it opens a few possibilities that I have in mind.

After a few research, I found a Sight/Light system used in the “Nothing to Hide” game and the guy who created it made a few tutorials discussing this system. So I went ahead, read all that, read the code, recreated the math and rebuilt using C++ and SFML. It’s a very raw thing that I have now, and it needs a lot of optimization but it’s work just as intended. You can check it here:

It’s a simple light system that casts rays in a few directions, finds the intersection points and then draw a big polygon connecting the dots of 2 lines.

I will be expanding this a lot for my game, at the moment is just a raw adaptation.

You can check the code for this on my GitHub repo here.

Classic Snake

A few days ago I decided to make a silly Snake game to see how stuff worked on touch devices and get a little more hang of Unity3D. I made this in a few hours (to be hones, the buttons took more time to make than the actual scripts) and it works great. The visuals could be updated, but this was more a quick thing that I made just for fun. There are high-scores, difficulty levels and a few other cool stuff.

You can get the Scripts code on my GitHub page here

And, If you want to install it in your phone, you can download the apk here.

Updates and lights.

After struggling with Tiles, I decided to make my own. I bought a “Wacom Intuous“, which makes drawing a lot easier, to start practicing digital art. I made a few tiles already but I probably gonna remake them once I get more practice. I’m aiming at a Pixel Art style, I know it’s being overused at the moment but It’s the best place to start and I really like doing pixel stuff.

Since the last update, I made a sound engine with “3D” sounds, a simple HUD to show HP and XP (the level system isn’t working yet, I’m adding 1XP per frame to test if the HUD is working as intended) and a few other things.

A few days ago I started fiddling with a Light System created by lolz123 called Let there be light. It was made for a early version of SFML so I had to adapt a few things but it’s very interesting. The main problem is that it’s taking a lot of FPS with only 2 lights and there are a few lighting bugs with walls when you get too close to them. I will definitely study more about the subject and fix/adapt what I’m trying to create and post the changes here or GitHub. You can check how it’s looking here:

Again, everything will probably change a lot. This little project is, after all, just an experiment.

Game update

After several days of reading through books and researching I have made a very simple game but with a very good core/base. At the moment the game offers a very good GUISimple shooting mechanics, a very dull AI with one kind of enemy and basic movements.

A few days ago, I was having a bit of trouble with the map system, it was just a static background with not much else and that was very ugly. So I started researching about 2D maps because I had no Idea how to make a proper one. (My first prototype took 500 fps out of the game with a 100×100 tile map). Looking through the SFML API, I found the Vertex Array which is a awesome thing that save a lot of time and is very fast.

But that still a bit annoying, because you need to design a map manually like this:


const int level[] = {

0, 0, 0, 0, 0,

1, 1, 1, 2, 0

0, 1, 1, 1, 0

};

And then I found Tiled, an awesome 2D Map editor that supports Layers, Several different types of views and a lot more. And it exports the maps as .Lua files which is perfect for me because I’m familiar with the language. It compiles a lot of useful information and the array ends up looking like this. You should definitely check that out.

Here’s a quick video of what I have at the moment showing the customization with Tiled:

All the sprites that are used in the video will change. I used them just to demonstrate how things worked and everyone’s art is credited in the video description. This is just to see how the game reacts and what should be improved.

Things that I’m working at the moment for the next “update”

  • Particle engine
  • Sound effects
  • More enemies with different AIs
  • More guns
  • Improve the map adding objects and buildings
  • Flexible camera

Delving into game programming

So I finally decided to get started in game programming.

A year ago, before entering college, I started working on a simple “Jokenpo” game, nothing too complicated or technical. It had a decent menu and the gameplay. It worked but code-wise it was a mess.

So after finally getting into C++ more, reading a lot about the new standard, I decided that it was time for me to start making something. I bought a few books and started making the skeleton of the game. Nothing is  decided. I don’t really have many sprites, just a very ugly ones that I quickly made to see how the games react and all that. But maybe soon I will have something to show.

The idea is a 2Dish shooter open world with lots of fun guns, quests and items. Yes, that’s quite a lot of stuff for a first game, but hey, challenge! I’m using the SFML Library which is a great 2D multimedia library, open source and with a great community.

The most difficult problem that I’m gonna have is probably with the sprites, since I’m horrible at drawing anything. But that will be quite fun to learn. Also I’m looking in a few techniques to use Blender to make a 3D element and then change into a sprite using Photoshop. I’m not quite sure how that will look in-game but I might give that a try.

More updates will come.

Notez!

notez_logo

I present to you… Notez!

This is a very tiny and compressed project of what I had in mind. A simple to-do list to manage life-general stuff. I started doing this for learning purposes. I didn’t know php at all before doing this, and since it’s a very usefull thing to know I thought why not give a shot at this ? It was very easy to pick up because of my coding background and in 3 or so days it was ready. I didn’t made everything perfect, but the security part should be good, I think. I don’t know all the exploits that you can do with PHP, but I did some reading along the way and think I covered a lot of stuff, salting, hashing, etc.

I’m a Computer Scientist, so the design part is very lacking. I try to do everything I can but you will have to excuse this part.

If you want to check it out, head over to: www.pridexs.com/notez and make an account!

If you have any feedback, found any exploit, managed to break everything, want to peak at the code or anything else, just leave a comment.

Let there be light!

Welcome stranger, how are you doing today ?

So this is my blog… Nothing too special, tried to make things as simple as possible. Updates on projects, random gibberish, news, interesting data… Everything will be posted here. I will be trying to do fun, interesting and usefull things and posting here.

The website will probably have two different themes for now. The first one I made myself and I’m very “proud” of it, even tho code-wise it’s a mess. The second one, that will cover the Blog and the Projects section, was made by someone else, and you can check the footer for more information!

Have a good day.