All posts by Oriol Gómez

About Oriol Gómez

Blind student of Translating and Interpreting, hobbyist programmer, adventurer, traveller. Currently in Germany for my Erasmus exchange year.

Releasing Jumpspots Applescript: search specific text on any website with the mac

Welcome, welcome!
After a long while without posts, here I am again, releasing 2 Applescripts for you to enjoy.
2 Applescripts which are used in combination, called jumpspots.

Ever heard of specific search addon for NVDA? Well, you can now do the same with your mac. sort of. This lets you search for a specific string of text, depending on a website’s title or URL. Well, it uses simulated keystrokes to type in the text which is less than ideal, but it is better than nothing, so let’s begin.

The first thing you need to do is to extract the zip file to the folder where you normally place your apple scripts.
Afterwards, you need to go to the voiceover commanders and assign both retrieve_text and save_text to whatever key you like the most, personally I have command trackpad flick up for save and command trackpad flick down to retrieve.
In any case, once you launch save text for the first time, it will tell you that, oh no, jumpspots.plist does not exist. this file is created in your documents folder and contains all your specific searches, you can just delete this file to start anew.

Once this file is created you will then be able to save a text, which uses information from safari’s current active tab. You can either choose to save it to the title of the current website (i.e. the window title), or the URL, such as http://www.facebook.com/buddylist.php.

Choosing one or the other depends on you, if the URL usually changes, choose the title. If the title of the site is dynamic and changes according to certain information, use the URL.

When retrieving text, it is important that you are not holding any keys while the script is simulating keystrokes. so if you are using command trackpad down, make sure you quickly let the go of the command key before the script runs. There is a small delay before it starts simulating keys, to give you enough time, such small price to pay for great functionality.

I will be modifying the scripts later, to add the possibility to only use part of the URL for the script, and to get rid of things like php variables which come after a questionmark, to allow for even more flexibility.

Please, make sure you clone the git repository for the latest update to these scripts at:
https://code.oriolgomez.com:9900/ogomez92/jumpspots_applescript

Getting started with coding new games in JavaScript

Introduction

Hello everyone, and welcome to a new blog post… I know I haven’t written in a very, very long time.

This post is for aspiring developers, as well as curious people who have been wondering just how that awesome cyclepath game was done, or why the hell Oriol updated beatstar to run on this weird thing called Electron and why it now runs on mac.

The answer is quite simple: Javascript.

When my friend Guillem first told me about audiogames written in Javascript, and showed me a weird prototype of something called dark Defender (yes, that game where you have a bunch of enemy space ships, motherships, falling screaming humanoids and other miscellaneous aerial parafernalia, I felt overwelmed because, even though I wanted to make cross platform games, Dark Defender’s code was complicated, I had 0 Javascript knowledge, and there was no standard way to do things as everyone was still experimenting.
Besides, isn’t JS a language for the web? How can you guys even think of coding audiogames like that?
However, I was pleasantly surprised to see that JS is not only a valid option, but a very interesting one at that. Not only is JS very fast, but it also has packages for anything you can think of (by the use of node and NPM).
There are many things you will need to learn that are quite different to BGT, and for this I suggest you to look at other audiogames written in JS such as Cyclepath, or the new upcoming version of Danger on the Wheel.
I suggest not to learn from JS from the new Beatstar, as much of the code uses unorthodox functions to access the filesystem which are typically not available in Javascript unless you use Electron (more on that later), but the coding style is a bit bgt-ish. The 2 main reasons for this are the following:
Firstly, I wanted to write Beatstar in JS as quickly as possible, so I took a bit of the bgt code and turned it around with the fewest code changes possible. Secondly, it was my first experiment in JS and thus I consciously ignored most of the advice I received from more experienced JS developers such as my friends Talon and Guillem.

With this in mind, Let’s move on to what really matters. The new audiogame coding template I am about to release for you all to start building games from.

A brief explanation about the development process

To download the game building template, you will have to get it via git clone by issuing the following command from the command line.
You will need to have git installed for this to work:
git clone https://code.oriolgomez.com:9900/ogomez92/template.git

There are two main ways to develop Javascript audiogames: My preferred option is to use Electron, a Chromium based browser which runs the game locally on my machine.
This is going to be your preferred way if you are planning to release your game as an Electron app rather than a web browser link. This is good for sound-intensive games like Beatstar which load a bunch of music, etc because loading from the hard drive is usually faster than downloading from the internet, unless the sounds have stayed in your cache. Either way, playing from the internet obviously requires an internet connection and thus, if your game doesn’t need one, an Electron app is just fine.
Developing via Electron is good if you don’t want to bother opening your web browser just to test a game. I know other people who prefer using the http server bundled with express, which creates a server pointing to port 3000 (usually) which you can then point to via your web browser by going to http://localhost:3000
Express is not installed via my template, so if you want to use it, you will have to install it via npm (npm install express) and read the documentation to get started.

NPM

NPM is a package manager for Javascript. It can be used to install, update, and remove unneeded JS modules that can be useful for your game. It contains everything you could think of, from sound libraries to maze generators, card decks, physics engines and much more.

when you first download the template from git, the NPM modules are not included to save some space. Before running the game you will need to install these modules by running the following command:
npm install

This command installs all the necessary modules needed to run the template.
You can add new modules by typing npm install modulename –save
The –save switch puts that module in the package.json, which is the container for all your dependencies. This means that, the next time someone downloads your cool new game from a git repository or you use it on another computer, that new module you are installing will also be taken into account.

About Parcel-bundler

Parcel-bundler is a handy tool which compiles your game, modules and all your imports so they are optimized and harder to read by people who want to look at your code with electron archive extractors. In always include it in my games because it lets me use imports in an eficient manner. For this reason, if you use my template you will have to run the following command before starting the game:
npm run watch
npm run watch tells parcel that hey, start looking for changes in the code, whenever a file is modified rebuild my game.

Once this is done, you can type npm run start to tell electron to open index.html, which you will not need to modify until you know the name for your new game. The name for your new game is in the html’s title tag.

Once Electron runs, you can check that the template is working by hitting control shift i (control option i on a mac). This will display the developer options. Click on console, and the console window should pop up saying: Setup success!

A note about sound libraries

Hey, I see some confusing files here! sonoSource.js, soundSource.js, soundObject.js… Why!

There are two main libraries for sound playback in Javascript: Howler and Sono.
The conclusion I came up with is that Howler is best for games which do not require HRTF, as it is much more lightweight. However, Sono has a bunch of effects, and both me and Talon have used it for games like Cyclepath and Danger on the wheel.

Conclusion

If you have done all these steps and it works, congratulations! You are ready to start experimenting with your new Javascript audiogame environment.
Please take a look at the explanations found in the file game.js, inside the client folder, and the sound playback example as well as the game timer.

If this post is well received, I will write more posts like this one explaining other things.

I hope this helps someone in their pursuit of audiogame development!

Beatstar pro: My latest audiogame project

As some of you may know, one of hobbies, when I’m not working or doing things for university is programming.
I have coded several audiogames (games without graphics) which are mainly geared towards blind people like myself.
In the last few months, I have been working on a very big update to my most successful game, Beatstar. Beatstar is a musical game where the basic objective is to follow instructions to complete sets of music beats, letting the player buy more soundpacks as he/she progresses.

Now, Beatstar pro has arrived, and it is no longer just a musical game. I have included three minigames: A boxing game, a slots game and a football game.
Programming this project has been lots of fun, especially recording the various unlockable achievements. I am sure that many of you will enjoy it as much, if not more than I have enjoyed producing them.

Beatstar pro encourages you to donate 10 euros as a contribution, but since many of you cannot or do not want to donate, the free version has 0 restrictions. It has exactly the same features as the full version and the code and sounds are 0% different if you donate.

To get the game, please visit my games site here and look for the download link or the donation button.

Thank you!

Quicktap for Android development blog part 1: Introduction, basic events

Hello everyone!
I’m glad to announce that I have started developing quickTap for Android.
Now I know many of you will ask, why start with quicktap? Why not make roadsplat for Android or something?

Well, there are various reasons wh I have decided to start with quicktap, the most important one being that it is an easy game to create. I could make an easier one like guess the number or something of the sort, but now that would be too simple wouldn’t it?

So quicktap. Yesterday I installed the Corona sdk available for free from Corona Labs
, and starting around with it.

The first thing I did was look at some of the example applications that come with the corona package. This way I learned about events, basic audio library usage, and some other useful things.
Since Lua is the language used in mushclient (the mud client that mush-z uses) I am already familiar with it, so I only need to learn corona specific concepts which seem to be quite easy to understand for now.

Corona has a number of issues though, one of them being that it does not produce content accessible to talkback. But since we are creating audio games, we do not need talkback support because I will be using audio files. I can already imagine a number of issues that will come up, but I will solve them as the game grows.

So after installing corona sdk I decided to think about how I was going to make a main menu. I looked around the network and found a corona file called swipeDirection, which basically lets me know when the user swipesup, down, left or right and this is what I will be using for the menu. Then I implemented network support and an event for stopping the introduction prematurely. Next step will be to implement a main menu with swiping and tapping, coding the game, and whatever else I can think of. An issue that nags at me rght now is how I’m going to get the phone to speak the numbers (corona sdk lacks tts support) but I’m going to try and write a number speaker class like that of bgt and use the numbers sounds I use for my windows games.

Looking forward to your comments!

Three months later

Three months after coming back I am in Barcelona again, continuing my Translating and Interpreting studies.
When comparing my life from before the Erasmus to what it is now, I’m going to take the risk and say that it changed a lot, and for good. I see myself more confident and independant and positive. At a personal level, I have learned a lot about life, friendships and personal relationships, self-confidence, personal administration and responsibility…

At an academic level, I have improved my German, I’ve learned a lot about German culture and I finally started interpreting, as well as many other things.

Now I am ready to get on with my life. I’d like to publish this blog as an electronic book on Amazon Kindle or Ibooks. If you are reading this on your Ebook or tablet, it means I achieved it.
Take a big hug from me and I hope that you recommend this blog to anyone you know who wants to visit Germany or another country.

Greetings, and remember: the force will be with you, always.

Erasmus in Saarbrücken, Germany: A road completed

I’ve been trying for days to find the best words to describe my experience in Germany as a blind Erasmus STudent, and the truth is that I can’t find them. I can’t find them due to the simple fact that I have lived so many experiences here, so many experiences that have “opened my eyes”, so many things I’ve lived through that have made me realize how important it is to be independant, continue with my studies…
I came here alone, and I’m leaving with many new friends, people that have become important for me and others that have accompanied me and were there through my best and worst moments. At christmas I made a list of people that were important for me, but I feel it now unnecessary. Firstly because there would be way too many people to list, and secondly because you know who you are.
In part I just want to go to Spain, go to Salou again, go to the Universitat Autònoma in Barcelona, spend time with my family… But on the other hand I just want to stay here. I guess it’s inevitable, otherwise it would mean I didn’t have a good time.
As a conclusion to this blog I’d like to give a shout out to everyone who is thinking of doing an Erasmus or an exchange, be it in Saarbrücken or any other city in any other country. Exchange helps a lot when you want to become more independant, organize yourself as a person and, most importantly, when learning a language.
I came here with a low to normal German level and I think I’ve learned a lot since then in the 10 months I’ve been here.
As you might have noticed when I began writing the blog, my first weeks here were tough until you get used to the people and the culture. The Germans are not like the Spanyars and the other Erasmus Students from other countries are not Spanyards, either. You can’t make the mistake of “teaming up” with the students from your country because then you don’t really learn the language.
And now, I’m going back to VIla Universitaria! Yesterday I got the confirmation that I have an apartment there, and I hope to have a good year, a more independant year thanks to my Erasmus in Saarbrücken, germany, a road to independence.

Germany World cup champions

Well, Germany won the World Cup. I think they really deserved it, given how well they played as a team, always going for the opposite goal whenever they could. When they won 7 to 1 against Brazil… That was incredible. I think it was just about time for a good team to teach the brazilian government a lesson, it was obvious that the WC was held there because they thoguht brazil would win.

But going back to the topic of my Erasmus, I only have 3 weeks left. and I’m starting to feel it. This last week I already had to say goodbye to a couple of my friends here that i doubt I will see in a long while. Sometimes I feel like I want to go back to Spain and other days I just want to stay here in Germany. I just hope to keep in contact with all the important people i have met here.
I still need to do some Exams. I’ve done well until now and I hope to go back to Spain with good grades.
These days life is pretty much the same. Study, meet with friends, stay home… I think that travels are over. 🙁

Second visit from my parents

My parents came to Saarbrücken this weekend! It had been about 6 months since I last saw them, and I missed them. They came on Sunday and a little late, because there weren’t any card to rent… and they had to go with the train and bus and such but they went the wrong direction and they ended up giong to Mainz! They had to travel 2 hours more. Oh well. At least they brought spanisch chorizo!!!
It went pretty well, we stayed about the city because with so little days we couldn’t really do much. Then we rented a car the next day. I don’t understand why my dad always wants to rent a car, I guess he’s not used to the German way of living. Many Germans don’t have cars and use public transport.
Anyway, I’m glad to see my parents, but at the same time it sucks because I don’t have much time here anymore and I need to start saying goodbye to people… Ten months ago I was thinking that I had the whole exchange thing in front of me, and now that it’s almost over, I feel it’s been too short.
Anyway, I hope Germany wins the World cup. 🙂 I saw the last two games with friends, last week we went to a barbecue and yesterday we were in the city at some bar to see Germany against Crazy americans. 😉