Pages

Saturday, March 9, 2013

Screenshot Saturday - Fresh as Fish

GangFight is a side-scrolling shooter game that I started to make a few days ago. It will be like old school arcade games. Also, I'm planing to add melee combat.

I will report weekly the development process and share images, videos, experiences. All these will be under the title of Screenshot Saturday. This week I will be presenting the images for characters and backgrounds. Of course, they're placeholder and as you can guess I draw them all by myself. It is better to use these kind of place holder images rather then one-color squares or circles. It's all about motivation I think.

Let's see the first drawings for the game.

The main character. The coolest bad-ass gang member ever. And he never gives up smoking even in a fight.

A member of Gang-H. Obviously, this gang have some fashion problems. And they're one of our enemies.

 The only road that you can see Ceasers Palace, El Capitan and Palms Casino side by side. This is also first scene of the game.

I'm making this game by using Java and Slick. And on the programming side, so far I made the followings:
  • Movement of player
  • Shooting towards the direction between player and mouse.
  • Basic enemy spawner
  • Main menu

So many things about the game is uncertain. There are a lot of things that I haven't started to think about. In this time, I want to be spontaneous and unorganized. For that reason, the game may be changed entirely in future.

[UPDATE] Now code for this project is on my Github. Fork me!

Thursday, February 21, 2013

Visualization of A* Algorithm - Final Version

Actually, I finished this project nearly a month ago but since I'm so lazy lately, I can write a post and put the program here at this moment. You can find more information about this project here my previous blog post.

Since then, all of the improvements were about GUI, adding load maze property and fixing bugs. As a GUI, I added radio button set which is used to replace starting and destination nodes and put obstacles.

After making some tests on the map, I encountered a problem. Since the algorithm can spread on every direction, the scenarios like in the image can create unwanted situations. Technically speaking, this is caused by diagonal search of neighbor nodes.


To avoid that, I added a radio button which enables and disables diagonal movement. Here is the new result of the same scenario. In this case, neighbor search is done only horizontal and vertical directions.


Other than these, I wanted to add an extra property which is loading maze to the map. With it, users can choose predefined mazes according to their difficulties. These are easy maze, medium maze, hard maze and dead-end maze. To do this, I used the idea of tile maps. I created txt files which includes numbers which are 0, 1, 2 and 3. Each of the numbers has its own node type. 0's are the normal nodes, 1 is the starting node, 2 is the destination node and 3's are the obstacle nodes.

0 0 0 0 0 0 0 0 0 0 0 0
 1 0 0 0 0 3 0 0 0 0 0 0 
0 0 0 0 0 3 0 0 0 0 0 0
0 0 0 0 0 3 0 0 0 0 2 0
0 0 0 0 0 3 0 0 0 0 0 0
This is an example of a txt file that includes nodes' information.

On the Java side, I'm going through all numbers in the file with two for loops and prepare the new state of the nodes according to the number that is read from the file.

In the class that I made this project for, as a difference, our professor wanted us to write software design document before starting project. Also at the end of the project, we wrote unit tests and user manual. I have to admit that I really didn't like writing these documents. Also, writing tests for the code that I wrote didn't sound meaningful to me. Maybe the idea for writing tests for others' code would be more meaningful. But, in a very limited time that couldn't be possible.

And of course images of the program:





You can download the executable jar here. Loading maze is not working in this version. Because it is using another folder which has maze files.

Before finishing the post I would like to share the links that gave me idea about how I should set up the GUI and choose colors.
http://www.ccg.leeds.ac.uk/people/j.macgill/xaStar/
http://www.youtube.com/watch?v=FNRfSQDF7TA

Wednesday, February 20, 2013

Game and gamedev websites

In this post, I will write some of my favorite web sites about indie games and game development.

News websites about indie games

Articles/Blogposts
(You can find extremely technical to the very high-level posts in altdevblogaday.)
(Most of the articles requires premium. There are free ones as well.)

Subreddits about games and game development
(There are very useful and awesome posts in these subreddits.)

Friday, February 8, 2013

My first attempt to mobile game development - Crazy Tic-Tac-Toe

There was  a mobile game development conference which was given by the creators of Gideros Mobile. Gideros Mobile is a platform that allows you to make Android and iOS games. And it uses Lua as a scripting language. 

After this conference, I wanted to make something and play it on my phone. That would be a different experience. And I chose Tic-Tac-Toe to start with. Because it doesn't require so many detailed sprites and relatively easy to code. Also it is really convenient to be played in touchscreen devices. Because players just tap on a square that they want to put an X or O.

After I started to develop, I saw that Gideros has a really nice documentation and forum. If you want to start mobile game developing, you should give it a try.

Here are the screenshots of the game: 


In-game images that shows the proceeding of the game.

Wednesday, January 23, 2013

Tweevio - What and how?

I really like doing something with Twitter API. Last year, while I was trying to learn Python, I wrote a script that receives the trending topics in Twitter. (You can see the code here.)

Now I'm planning to do a project with using Twitter API again. Actually, I'm thinking on it very long but I have a chance to make it happen at this moment. I even gave a name for it: Tweevio.

Tweevio will show the last Youtube videos that are shared in Twitter. Yes, that simple.

After this convincing explanation of the project, let see how I'm planing to do this project:

I think I have to use Youtube API for playing videos. Also, I'm planning to use jQuery library. Actually, I don't know jQuery but in CodeAcademy there are really good tutorials. I will follow those tutorias to have an idea. The reason I choose jQuery is to make my job easier on sending HTTP request and JSON parsing.

Before starting this project, I separated the things that will be done into simple tasks. Here they are:
  • Send HTTP request to Twitter Search API. And store the response in a variable. (Youtube.com, youtu.be will be searched in tweets.)
  • Parse the JSON which will come as response and extract Youtube links from it. (Maybe using regular expressions.) 
  • Write a simple website which just has an input box and button. This website will show the Youtube video whose url is entered in input box.
  • Prepare a very simple website with Twitter Bootstrap. (Use placeholder images.)

This is the design of the site created with Balsamiq Mockups.

Tuesday, January 22, 2013

Plans for semester break

  • I want to follow Scala course on Coursera which is given by Martin Odersky. I have no functional programming experience. I want to enter into this area with this course.
  • I will look over Play! framework which is used to build web applications with Scala and Java.
  • I will also follow jQuery and API lessons in CodeAcademy. In CodeAcademy, in order to pass a course, you have to write codes and complete missing parts. I think it's a great way to learn.
  • I have a little project which uses Twitter API. I want to complete it. Also I will write a blog post about it.
To accomplish all the things above can be difficult. Because, I have bad experience about these kind of todo lists. I can get bored and leave the things that I'm working on. Related to this, a few days ago I saw a video on Facebook. I think the guy in the video has a point. I will give ear to things the guy emphasizes. I think you should check this out, too.


Friday, January 18, 2013

Download Manager Project - Bash scripting

The download manager is the project that I made for UNIX Scripts and Utilities course. I used bash scripting and dialog. Dialog is for the GUI of the project.

The reason that I chose this project is sometimes I download lecture slides of courses that I'm interested in. For example, since MIT opened the most of their courses, I want to download the lecture files to see how they go over the courses and what the homeworks are. Downloading whole files by clicking every link was exhausting. At this point my project is lending a hand to make things easier.

Actually you can download files from a web site by using wget command. To download specific types of files like pdf files, you can give the extension of the file with -A parameter. Let's see an exampe of this.

       wget -r -A.pdf http://www.cs.ozan.edu/~yildiz/prog101/

This command will download all pdf files in the given website which is supposed to include lecture slides or homeworks.

Since the aim of the project is using grep, sed, awk, cut and provide GUI to the user, I should have used something else. And I came up with this:

How does the script work?
  • After a user enters comma-separated urls of web pages, the script keeps a list of urls by using awk command.
  • The script has a loop to iterate over those urls.
  • Then, the source of a web pages is downloaded with wget -k -O command. -k parameter is to convert all relative paths to absolute path.
  • Then, grep extracts these absolute paths by looking file extensions and write them into a file. (The extensions of the files that are going to be downloaded is predefined.)
  • Another loop downloads all files one by one. Also download bar is increasing when a file is downloaded.
  • The script also keeps the history of the downloaded files.
And of course images of the project:

This is the part that user enters links.

Downloading screen. We are able to see the file that is being downloaded.

I put the codes to my gist. Click here to see the code. You can add new file extensions to be downloaded by modifying extensions variable.