DarkBASIC Pro

>> Thursday, June 3, 2010

So, as DarkBASIC Pro is free now, I decided it may worth trying it. I tried DarkGDK and Blitz before.
What I love about DBPRO are the commands.
They are pretty nice, I'm playing with networking right now and it works pretty well, also the documentation, for someone who actually can program in a competent language, is very easy to understand and helps a lot, you don't really need much more documentation than the one the editor's help documents give you.
That's another thing, the editor is pretty nice :)
I didn't try 3D stuff yet as I do not know much about it, but what I tried so far seems very good.
The language, of course, has it's limitations, even more than others BASIC dialects, but it's nice enough as to let you make games.
Pretty "big" games have been made with the language, so it's possible, and easy to pick up.
If you really hate DBPRO language you can use GDK which is basically all DBPRO specific functions in available in C++.
Also, DBPRO uses DirectX 9.0c and they may port it to DX10, which would be pretty nice indeed.
As it's aimed to beginners help at the forums and functions itself in the language are pretty easy to use, and one of the best choices to begin game programming.
I'm even considering making a guide about it, I'll surely make some tutorials which I may add there if i do make it :)
So! I'm playing with game programming here, planning a nice series of tutorials to share the world, wish me luck!

Read more...

FXRuby :: Events

>> Thursday, May 13, 2010

As you might know, when we do graphical user interface, we are actually doing an event driven application. What does it mean? Simple, our application recieve and respond to events, normally, it does nothing unless something happens, for example, until you press a button, or close the window.
This concept is pretty general, almost every program you use which uses GUI (Graphical User Interface) does nothing when you do not make any event (except of course for repainting sometimes, and maybe auto-save and other features, but, you know what I mean :)), in this tutorial I'll teach you the basics about handling events in FXRuby.
Let's make a program with a button in it.

#!/usr/bin/env ruby

require 'fox16'
include Fox

class HelloButton < FXMainWindow
  def initialize(p)
    super(p, "Hello Button", :width => 100, :height => 100)
    
    @button = FXButton.new(self, "Push me", :opts => BUTTON_NORMAL|LAYOUT_CENTER_X|LAYOUT_CENTER_Y)
  end
  
  def create
    super
    show(PLACEMENT_SCREEN)
  end
end

if __FILE__ == $0
  FXApp.new do |app|
    HelloButton.new(app)
    app.create
    app.run
  end
end

Good, hopefully you understand that code, basically, unless you are familiar with FXRuby I recommend taking a look at the documentation for each component. So you know the constructor, and the basic behaviour.
If you take a look at the FXButton documentation, you'll see an event list, each with a brief description, those are all the events the FXButton generates.
The events for FXButton looks like this

SEL_KEYPRESS:sent when a key goes down; the message data is an FXEvent instance.
SEL_KEYRELEASE:sent when a key goes up; the message data is an FXEvent instance.
SEL_LEFTBUTTONPRESS:sent when the left mouse button goes down; the message data is an FXEvent instance.
SEL_LEFTBUTTONRELEASE:sent when the left mouse button goes up; the message data is an FXEvent instance.
SEL_COMMAND:sent when the button is clicked.


All constants beginning with SEL_ are called Message Types, the SEL_COMMAND is a special message type, as it's the default and most obvious behaviour, and the one you'll use the most. Another thing you'll see when dealing with events are Message Identifiers and Data Objects, message identifieras are basically an identifier of the widget which generated the event, and data objects depends on the widget, it gives extra information on the event.
If you take a look at the FXButton events list up there, you'll see that the data object is a FXEvent, the documentation for this object tells you all it's atributes and methods. You can find the atributes list below:


click_button  [R]  Mouse button pressed [Integer]
click_count  [R]  Click count [Integer]
click_time  [R]  Time of mouse button press [Integer]
click_x  [R]  Window-relative x-coordinate of mouse press [Integer]
click_y  [R]  Window-relative y-coordinate of mouse press [Integer]
code  [R]  Button, keysym or mode; DDE source [Integer]
last_x  [R]  Window-relative x-coordinate of previous mouse location [Integer]
last_y  [R]  Window-relative y-coordinate of previous mouse location [Integer]
root_x  [R]  Root window x-coordinate [Integer]
root_y  [R]  Root window y-coordinate [Integer]
rootclick_x  [R]  Root window x-coordinate of mouse press [Integer]
rootclick_y  [R]  Root window y-coordinate of mouse press [Integer]
state  [R]  Keyboard/modifier state [Integer]
target  [R]  Target drag type being requested [Integer]
text  [R]  Text of keyboard event [String]
time  [R]  Time of last event [Integer]
type  [R]  Event type [Integer]
win_x  [R]  Window-relative x-coordinate [Integer]
win_y  [R]  Window-relative y-coordinate [Integer]

As you can see, we have many atributes we can use to get more info on the event, you can make this with every widget, get the Message Type and Data Object information.
If you haven't realised so far, you'll need to have the documentation handy when writing your first applications, until you get very confident as to do them by heart. Documentation is always handy :)

Back to our code, let's see how to connect an event to our code, in earlier FXRuby versions and original Fox library, the way to do it is pretty harder, but luckly for us, FXRuby makes it easy for us now!

#!/usr/bin/env ruby

require 'fox16'
include Fox

class HelloButton < FXMainWindow
  def initialize(p)
    super(p, "Hello Button", :width => 100, :height => 100)
    
    @button = FXButton.new(self, "Push me", :opts => BUTTON_NORMAL|LAYOUT_CENTER_X|LAYOUT_CENTER_Y)
    @button.connect(SEL_COMMAND, method(:btnPressed))
  end
  
  def btnPressed(source, msgtype, data)
    FXMessageBox.information(self, MBOX_OK, "Click!", "You clicked the button!")
  end
  
  def create
    super
    show(PLACEMENT_SCREEN)
  end
end

if __FILE__ == $0
  FXApp.new do |app|
    HelloButton.new(app)
    app.create
    app.run
  end
end

As you can see, we use the connect method which every widget has, to connect the widget with an event. There are two ways to do it, that is just one, I'll show the other one soon.
With this method, the connect method takes two arguments, the Message Type, and the name of the function it'll call, please note that the function must use three arguments, one for the sender, other for the selector and the last one for the Data Object. The first argument is the sender of the message, it's just a reference to the object with sent the event, the next object its called selector, is a mix of the Message Type and Message Identifier, you have a method to manipulate that and get the Type or the Identifier as you like.
As you can see in the documentation, the SEL_COMMAND Type of the FXButton class does not have a data object, so we cannot get more information on the event, we just know the button was pressed, and in most of the cases, that's all you need to know.

Let's take a look at the other way of making a connection, and lets use the data object, we'll need to connect to other event though, so we'll connect with the SEL_LEFTBUTTONRELEASE event.

#!/usr/bin/env ruby

require 'fox16'
include Fox

class HelloButton < FXMainWindow
  def initialize(p)
    super(p, "Hello Button", :width => 100, :height => 100)
    
    @button = FXButton.new(self, "Push me", :opts => BUTTON_NORMAL|LAYOUT_CENTER_X|LAYOUT_CENTER_Y)
    @button.connect(SEL_LEFTBUTTONRELEASE) do |sender, selector, data|
      x = data.click_x
      y = data.click_y
      FXMessageBox.information(self, MBOX_OK, "Click!", "You clicked at [#{x},#{y}]")
    end
  end
  
  def create
    super
    show(PLACEMENT_SCREEN)
  end
end

if __FILE__ == $0
  FXApp.new do |app|
    HelloButton.new(app)
    app.create
    app.run
  end
end

As you can see when you click a few times, the location is relative to the widget, and the buttons stay as pressed, you can change that, but for now, we'll just leave it like that.

So you learnt how to connect events, and using the documentation to get information about events and data objects, hopefully you'll now be able to catch any event you need.
I'm gonna explain one more thing though, sometimes, you have to update data "automatically", for example, while an user type his name, you can save it, or when you modify your data, you want your GUI to reflect those changes.
This is done by calling the SEL_UPDATE event, the application sends SEL_EVENTS once in a while, so you can use this event to update your model1 data.
It may seem hard to understand but it's really very easy, check out this example

#!/usr/bin/env ruby

require 'fox16'
include Fox

class HelloButton < FXMainWindow
  def initialize(p)
    super(p, "Hello Button", :width => 100, :height => 100)
    
    @activeMode = true
    
    @button = FXButton.new(self, "Push me", :opts => BUTTON_NORMAL|LAYOUT_CENTER_X|LAYOUT_CENTER_Y)
    
    @button.connect(SEL_COMMAND) do |sender, selector, data|
      @activeMode = false
    end
    
    @button.connect(SEL_UPDATE) do |sender, selector, data|
      if !@activeMode
        @button.state = STATE_ENGAGED
      end
    end
  end
  
  def create
    super
    show(PLACEMENT_SCREEN)
  end
end

if __FILE__ == $0
  FXApp.new do |app|
    HelloButton.new(app)
    app.create
    app.run
  end
end

As you can see, we connect the button state to the activeMode variable. Whenever that variable is changed, no matter how it was changed, the button will update.
You can also use this to update a widget when another widget is hidden, for example.

Okay, that's it for the Events, hopefully you'll now have a basic understanding of how FXRuby manages them.

*1: See Model View Controller (MVC).

Read more...

FXRuby :: Hello, World!

>> Tuesday, May 11, 2010

Hello! And welcome to the first tutorial! In these tutorials I'll try to explain how to use FXRuby in an efficient Ruby-ish way, and try to show how easy and useful it is! In each tutorial we are going to make a program to explain the tutorial topics better, I'm a fan of real-life examples, and although we are not going to make complete applications, the programs will show FXRuby features nicely (I hope!).

In this first tutorial I'll explain the very basics about FXRuby, and how to make the most simplistic program, the "Hello, World!". I'll assume normal Ruby knowledge. If you don't know Ruby or wanna refresh some stuff, here is a free online book, and here is another :).
Okay, let's begin, first of all you have to install FXRuby, the good news are, that FXRuby is packed with the standard ruby distribution, so if you have ruby you already have FXRuby :)
Let's begin doing the almost mandatory "Hello, World!" program. That program is normally a program which only output is "Hello, World!".
As we are doing GUI here, we could translate that into a window which writes "Hello, World!" somewhere in there, so let's do that.

#!/usr/bin/env ruby

require 'fox16'

app = Fox::FXApp.new

mainWindow = Fox::FXMainWindow.new(app, "Hello, World!", :width => 300, :height => 200)
mainWindow.show(Fox::PLACEMENT_SCREEN)

app.create
app.run

When you run that code, you'll see something like this.


That's it, we made a window, and if you have worked with some other GUI frameworks you'll know that, that was pretty easy :)
Let's review the code, first of all, we require fox16, which is the gem we are going to use.
All Fox applications have one FXApp object, which is the actual application, we are gonna add all the "stuff" there.
Next we create a FXMainWindow, as you can see by looking at the documentation, it has some optional parameters, but the required ones are app, and title, as a title we used "Hello, World!".

Note for Java programmers: One thing that makes different Fox from Swing, is that, in Swing, you have a parent controller and you add a child to the parent controller, in Fox, you specify the parent of the child controller, and that's how you add new components.

FXMainWindow also has some optional parameters, we sent :width and :height in order to specify...well...the window width and height :)
By default all windows are hidden, so we call the show method of the FXMainWindow, we pass the PLACENEMT_SCREEN argument just so it centers on the screen.

The next lines of code are required in order to run the application, I'll explain them in more detail later on, but by now, just know that you'll need to call create and run.

That works great for what we want to do, but it's not a very Ruby-ish way, we could write exactly the same with this code

#!/usr/bin/env ruby

require 'fox16'
include Fox

class HelloWorldWindow &lt; FXMainWindow
  def initialize(app)
    super(app, "Hello, World!", :width => 300, :height => 200)
  end
  
  def create
    super
    show(PLACEMENT_SCREEN)
  end
end

if __FILE__ == $0
  app = FXApp.new
  HelloWorldWindow.new(app)
  app.create
  app.run
end

As you can see, it looks like a normal Ruby program, but one thing is very important, note we can inherit from the FXMainWindow class, if you have done Swing, this will look very familiar, and it's a very good thing! That means we can extend the base class and add our own functionality to each of Fox's widgets, in a very easy way.
If you run the program now, you'll see exactly the same output, the same window we saw before.
Finally, let's just add a label with the "Hello, World!" text, we can add a label using the FXLabel class, in this case we just want the default behaviour so we wont create a new class for the label.

#!/usr/bin/env ruby

require 'fox16'
include Fox

class HelloWorldWindow &lt; FXMainWindow
  def initialize(app)
    super(app, "Hello, World!", :width => 300, :height => 200)
    FXLabel.new(self, "Hello, World!")
  end
  
  def create
    super
    show(PLACEMENT_SCREEN)
  end
end

if __FILE__ == $0
  app = FXApp.new
  HelloWorldWindow.new(app)
  app.create
  app.run
end

If you look at the documentation for the FXLabel class you'll know we just need to send the parent widget and the text we want to display as parameters.
If you run the program you'll see something like this


We have done our "Hello, World!" program in a very extensible and object oriented way, a very Ruby-ish way, that will allow us to extend the application very easily.
That's all for this tutorial, hope you find it useful! No downloads for this tutorial as it's only the source code you can find above.

Read more...

FXRuby - Project

>> Monday, May 10, 2010

I've spent quite a while deciding on which Ruby GUI library to use, and I decided I'll go for the simple, FXRuby is a great choice, I'm so happy I could get the book I'll write a progressive series of tutorials about FXRuby here :)
I decided to go back to Ruby GUI because I'm planning on some nice projects, and I always liked Ruby over Python, I dont really know why, but to make a long story short, I'll make a list with the benefits of FXRuby

  • You can make an OpenGL Canvas to use OpenGL and 3D in your program
  • It's included in Windows and Mac distribution of Ruby
  • It looks the same on all OS's, and I think it looks nice :) 
  • It's fast, as its basically a Ruby abstraction of the original C++ library (although there is a good part of FXRuby written in ruby)
  • It's Object Oriented, this makes it very easy to extend each widget, as I'm used to Java Swing, this is a very important point for me, as I find this very convenient
  • It's easy to learn compared to other huge libraries
  • And more :) 
There is a nice documentation on this, but it's not so popular, so i decided to help it out by writing my own tutorial serie, once I finish, the series will be available in PDF and examples code.
The first tutorial will be out soon, be ready!

Read more...

NekoCM Utils released as Open Source!

>> Wednesday, May 5, 2010

You can now contribute to NekoCM Utils! Although I dont know if many people is interested right now ;)
I will surely have more projects later, anyways, feel free to contribute / edit / use / etc.
NekoCM Utils is released under the LGPL licence.
You can find the mercurial repository here: http://www.bitbucket.org/fedekun/nekocm-utils

Enjoy~!

Read more...

Patatamosh

>> Sunday, May 2, 2010

Patatamosh will be a 2D fighting game which I will develop in order to test BIP so far. I also want to make it very extensible, so characters code is embeded inside Patatamosh.
Characters code is in Groovy, which is a very nice interpreted dynamically typed OO language, and can also be used as normal Java. So you could just use Java to write your own characters code :)
So far it's going pretty smooth, I will post all updates here. Wish me luck! 

Read more...

BIP Upgrades

>> Saturday, May 1, 2010

Well I've worked a bit more on BIP, the Input class now read a sequence of keys with a given delay, useful to check for actions if you are makign for example a fight game.
Also the Sprite class has been modified, the way to load spritesheets has changed, now it loads spritesheets with no requirement of it to have the same size for all images, it reads spritesheets generated by this program (which i reccommend by the way).
Another thing that changed from the Sprites class is the way to add animations, now, when you pack the spritesheet each image has it name you can use to add animations, for example say you have the images

  • wk_punch_1.png
  • wk_punch_2.png
  • wk_punch_3.png
  • wk_punch_4.png
You could add an animation by doing this

addAnimation("wk_punch", new String[]{ "wk_punch_1", "wk_punch_2", "wk_punch_3", "wk_punch_4" });

Way easier IMHO.
Also I fixed some bugs with Mouse Input and finished a little Button class, inside the gui subpackage. In the future I think it will have some more basic gui components, nothing fancy, I'll see how hard it is to give a simple interface to use swing or awt, BIP is all about simple interfaces :)

Read more...

NekoCM Util - Printer

>> Wednesday, April 28, 2010

This is a little utility I'm working on. It's still under development. Basically is a simple way to print something using Java.
Normally to print something you will need to use the Print API, which is pretty annoying, so i googled and found this tutorial, it worked very good! For simple purposes is the easiest way by far.
I used it and by using it I realised I could make an API with the simple stuff I was doing, I planned on improving it later, and that would be some work because you would normally want to do that when using that tutorial source code, so I decided to do that, the result is very nice! It really helped me.
Right now the first NekoCM Util class is about printing, under the package com.blogspot.nekocm.util.print.
The idea behind that is basically make a print preview window, in the window there is a JPanel in which you draw what the page (Currently only A4 size) is gonna look like. And that's it! No worries about anything else, here is the example code.

PrintExample.java

import javax.swing.*;

import com.blogspot.nekocm.util.print.PreviewPrint;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class PrintExample extends JFrame {
 public PrintExample() {
  super();
  this.setTitle("NekoCM - Print example");
  this.setSize(new Dimension(300, 200));
  this.setVisible(true);
  this.setLocationRelativeTo(null);
  this.setLayout(new FlowLayout());
  this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

  JButton btn_print = new JButton("Print");
  btn_print.addActionListener(new ActionListener() {
   @Override
   public void actionPerformed(ActionEvent arg0) {
    new PreviewPrint(new PrintExamplePanel());
   }
  });
  this.getContentPane().add(btn_print);

 }

 public static void main(String[] args) {
  try {
   UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  } catch (Exception e) {
   // best to do nothing here
  }
  new PrintExample();
 }
}

PrintExamplePanel.java

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;

import com.blogspot.nekocm.util.print.PreviewPanel;

public class PrintExamplePanel extends PreviewPanel {

 public PrintExamplePanel() {
  super("A4");
 }

 @Override
 public void paint(Graphics2D g) {
  Graphics2D g2d = (Graphics2D) g;
  g2d.setColor(Color.WHITE);
  g2d.fillRect(0, 0, this.getWidth(), this.getHeight());
  g2d.setColor(Color.BLACK);
  g2d.setFont(new Font("Arial", Font.PLAIN, 20));
  this.writeAligned(20, "center", "Neko CM", g2d);
  g2d.setFont(new Font("Arial", Font.PLAIN, 11));
  this.writeAligned(-1, "left", "\nThis is an example\n"
    + "of NekoCM Print lib", g2d);
  this.writeAligned(-1, "right", "Enjoy~", g2d);
  this.writeAligned(-1, "center", "\n\nhttp://nekocm.blogspot.com", g2d);

 }

}

That will produce something like this



You can now download the Eclipse example project or just download the api.
Hope you find this useful! I will update this as soon as I improve it, although right now I'm more into BIP (which is also improving by the way ;))

Read more...

Generic Game

>> Saturday, April 24, 2010

BIP is 60% finished, and my first project with it, may be an overkill, aiming to improve it, (although it does not requires a tile map! which is what BIP is needing right now) I'll make a fighting game, but i want the game to be somehow like MUGEN, so you can customize the characters, each attack, animation, etc. I have interesting ideas, which I will post if i succeed with the first steps. Whish me luck!

Read more...

BIP - Managers

>> Thursday, April 22, 2010

I added a Sprite Manager and Audio Manager to BIP, now is very easy to load and play sounds. The Sprite Manager basically is a Vector with many sprites, so is easier to update and draw them all, is somewhat similar to DarkGDK way of managing sprites if you want to think it like that, you can check for collision doing something like this:

if(manager.pixelCollide(1, 5)) { /* Collision! */ }

That will check for collision between sprites 1 and 5.
Also I added a Button class inside the "gui" package, it's a very basic abstract class, the way you make buttons will be inherit from that class, and define your own actionPerformed method, then just call it with an image and a location, and optionally an image for the hover state.

BIP seems to be doing pretty nice so far, so I'm planning on using it in a small project now, which do not need tiled maps, to test it and improve it.

Read more...

CodeIgniter

>> Monday, March 29, 2010

CodeIgniter is a PHP framework, which is pretty fast and easy to learn.
Not many years ago I didnt really care much about frameworks, i had my little nice set of functions I collected during the years, and I didn't have much problems editting and creating new sites, but for some reason I decided to try frameworks.
I have always liked open source, so I really liked the idea of people sharing their awesome functionality, and if you dont have much experience with MVC starting with CodeIgniter is a great option! It takes like 30 minutes to read the begginer documentation, and then you have awesome reference, you may develop a bit slower first, but later you will do it faster! And in a very scalable way!
What is nice about using frameworks is that if it's a project where more than one person works (Including MVC advantages already) you know what to edit, you know what to do already, no need to lose time reading what other programmer structure is!
It has many many advantages, I will just say, i recommend it!
I have used for my last projects and it works flawlessly! I also like sharing my own libraries :) I made an excel plugin, to export an xls file.
Anyways! If you develop on PHP, i would say this is a very nice tool!

Read more...

Color Getter

>> Tuesday, March 23, 2010


About
This is a little program I made for my girlfriend (Alba ♥!) and i really liked helping her, also the program ended up very nicely, she had a very good idea!
The program is in spanish but you can make an idea easily :)

What is it about?
Well my girlfriend had a problem, she sometimes wanted to get the color of something on her screen, but it takes way too long to take a screenshot, open photoshop, zoom and then extract the color, so this program makes it easy! It's simplistic as i like my programs to be!

Here you can see the main window, you just click there to take a screenshot, a new window will open with the screenshot and more options!


That is a screenshot of my desktop (Yes, i use Windows XP) just click anywhere to get the color, your cursor will change to a crossair, you have three buttons there also, you can zoom with those if its hard to get the color you want!
You can get my program clicking the following links:
Hope you find it useful! Special thanks to my girlfriend, Alba, for her great idea! ♥

Read more...

GoFTP

>> Friday, February 5, 2010

GoFTP is my new favourite FTP client, for one main reason, its fast, and i mean FAST, you can see a chart at GoFTP website but for me that i have to work with a lot of joomla sites, download and upload them, it's very nice, i definitely reccommend it.
Quoting GoFTP website here are a list of nice features
  • "Instant Connect" Technology
  • "Instant Directory" Technology
  • Multi-connection transfers for maximum bandwidth utilization !!
  • On the fly file compression for amazing transfer speeds !!
  • You simply have to try this FTP program to believe it.
Just try it, you wont regret ;)

Read more...

More advances with Java and BIP

>> Tuesday, January 12, 2010

So right now i'm working on the Sprite class, which will handle basic sprites and spritesheets.
To use it basically you will have to make a new class and extend the Sprite class, and just define the update method. Later on the main loop just do mySprite.update(); and mySprite.draw(); and it will do :)
You will be able to add animations if it's a spritesheet, just like by doing something like addAnimation("walking", arrayOfIntsRepresentingFramesSecuence); so later you will be able to just switch animations. Also there will be an option to set a default animation, which could be the character just standing there, which will be set each time the user input is null.
Another thing the class will have is collision detection, rectangle and pixel-perfect.
The input class is pretty simple but I really like how i turned out, it's very easy to use.
Once i finish the Sprite class i think i will continue with sound, and then with tiled maps.
As i don't have much experience with network programming i dont think i add this feature for a while, at least untill i tried some games and play with networking for a while.
Also it's possible but i dont think i do, it's add 3D support, i dont have much experience in this issue and i'm not sure of Java capabilities with this, if i have to add OpenGL for this to work good i dont think i add it, mostly because i dont know much OpenGL, and also i want this to be pure java for certain reasons, so, maybe just for fun i could add it with normal Java but, we'll see, i dont really think so, plus the priority is 2D, BIP will be a 2D library so probably 3D wont be there.

Read more...

Advances with Java and BIP

My little BIP library seems to become reality in a not very distant future, of course it still needs a lot of work but as i read my books, i add and develop that part of the framework, for example i finished graphics and input chapters and i implemented them on my framework, while testing a little game :)
The final touches will be useful functions, such as a nice Sprite class, Mappy loader, etc.
Right now, i made it possible to make windowed and fullscreen games, and if windowed, the window size fixes itself so the drawing area is actually what you request.
The architecture so far is simple and similar to all libraries out there, extend the Game class, implement the abstact methods and just start making your game without worrying about low level stuff and using what you know of Java Graphics2D object.
It uses Page Flipping / Double Buffering automatically depending on the situation (Fullscreen capabilities, windowed mode, etc) and it uses "the delta method" of managing updates, this means it doesnt try to keep always the same rate of UPS' but instead it gives you the time it has passed since the last frame update so you can calculate how much to move stuff, this is also known as a way to set speed to "pixels per millisecond" which is my favourite way because its simpler.
The method i use to check for input is similar to Flixel's i think, just a static Input class with a lot of nice methods to check for keyboard and mouse events (KeyDown, KeyHit, MouseX, etc).
I will post here the progresses of my little library and i hope i can finish it and it gets to be a nice and simple library, mostly for me, and my university projects which doesn't allow me to use third party libs, but also to share with the programmers community which has helped me so much during the few years i have been around.

Read more...

New Riders Publishing - Developing Games in Java Review

>> Sunday, January 10, 2010


This book is one of the best i ever saw / read, about Java Game Programming.
It assumes you already know Java and start from Chapter 2 with game programming! (Chapter 1 is about Threads!)
It explains everything really nice, and step by step.
I just read it to Chapter 3 so far, but i felt like making a review now because i have to admit that is one of the bests i saw (I skipped some chapters to see how it is though, hehe).
If you are serious about Java game programming this is a must. I like it much more than "Killer Java Game Programming", although that is also a very good book which is reccommended to read after / before this one if you are serious on Java game programming, so i probably will finish reading that one later ;)
For now, i will keep with this one untill i finish it, im pretty excited! As i'm not a beginner game developer (not a pro also) i like to go straight to the point, and not have to eat those long Java explanations you already know! :)
This book is definitely recommended! 5/5.

Read more...

Java Game Programming

Right now, im playing with Java game programming. Plain Java, with FSEM, Swing and AWT.
I wont use OpenGL libraries like Slick for personal reasons :)
I like using plain java though, after i write some games i might try making a simple library to help me setup games faster, and will make it public, probably under BSD licence.
The project i want to make is a simple Fighting Game, so i will need to implement very good collision detection, and i wont need tiles for this game :)
It will be oriented to multiplayer games, not networking though, assuming both are on the same PC.
I will later implement the AI to play against the "machine". There is a long way to go, and i will post here my advances.

Read more...

  © Blogger template Simple n' Sweet by Ourblogtemplates.com 2009

Back to TOP