Ir al contenido principal

Learning easeljs Day#4

So, I decided that I wanted to practice and learn my JavaScript skills doing video games. I wasn't sure with what I should begin, as I have try this several times and fail.

So I found this library easeljs. It's really easy to use it.
This post and the future ones, are to share, part of the code and explain some of the things I had issues to manage, probably this can help somebody.

See the Pen Running-Scripts V2 by Diego (@diegotc) on CodePen.

    function init() {    
    stage = new createjs.Stage("demoCanvas");
    circle = new createjs.Shape();
    spriteSheet = new createjs.SpriteSheet({
        framerate: 5,
        "images": ["man2_rt1.gif","man2_rt2.gif","man2_Up_rt1.gif","man2_Up_rt2.gif","man2_Down_rt1.gif","man2_Down_rt2.gif"],
        "frames": {"regX": 16, "height": 32, "count": 6, "regY": 0, "width": 32},
        "animations": {
               frames: [1,0],
               next: "runRight",
               speed: 1
                frames: [3,2],
                next: "runUp",
                speed: 1
            frames: [5,4],
            next: "runDown",
            speed: 1
           "stopRight": [0,"stopRight",0],
           "stopUp": [2,"stopUp",2],
           "stopDown": [4,"stopUp",4]

    grant = new createjs.Sprite(spriteSheet, "stopRight");
    grant.x = 50;
    grant.y = 50;"black").drawCircle(x,y,10);
    createjs.Ticker.addEventListener("tick", tickFn);

When I create new spreadsheet, I select the first frame, that I want the sprite to begin, so in this is the stop image

grant = new createjs.Sprite(spriteSheet, "stopRight");


Entradas populares de este blog

Find which devices are connected to our network

Sometimes, we want to know how many devices are connected to our network. With any Unix OS you get easily know this. For this small tutorial we´re going to use Lubuntu 16.04.

We will use nmap. Nmap (Network Mapper) is a security scanner. It is used to discover hosts and services on a computer network.

For installing it, we first do

sudo apt-get install nmap
If we just need to identify the host names

 sudo nmap -sL  The result of this command will be

Starting Nmap 7.01 ( ) at 2016-10-02 12:39 CST
Nmap scan report for
Nmap scan report for
Nmap scan report for
Nmap scan report for
Nmap scan report for
Nmap scan report for

If we need to know the OS of the devices we have connected we do a:

sudo nmap -O
The address depends of your network, you should do a ifconfig for knowing yours.
The result of this command will be something like this:

Nmap scan report for 192.168…

La ultima alegría de los sampedranos del 2017

El año 2017 esta por terminar, y para la ciudadanía de la capital industrial ha sido un año singular. La ciudad se enorgullecía de que en nuestro Aeropuerto Ramon Villeda Morales, íbamos a tener el único vuelo directo entre Europa y Honduras. Finalmente se empezaba a ver obras de infraestructura concluyendo en el tiempo establecido. Se podían observar los cruces de cebra en las intersecciones de la tercera avenida y primera calle, aparte que los conductores empezaron a respetarlos, y no digamos los semáforos peatonales que lindo es ver como la ciudadanía espera su momento para cruzar por el lugar que le corresponde.

Parecía que este 2017 iba a ser un año de alegrías para la ciudad, y que no iba a suceder  algo que lo podría devastar esas pequeñas alegrías que nos hacían olvidar todas esas políticas de gobierno provenientes de la capital, que han perjudicado al  territorio nacional y no digamos a la ciudad que produce mas del 40% del PIB del país .

Llegaban las elecciones y el actual a…

Access to AWS Postgres instance in private subnet

I have been working with AWS in the last days and encounter some issues when using RDS.  Generally when you're working in development environment you have setup your database as Publicly accessible and this isn't an issue. But when you're working in Production. So we place the Amazon RDS database into a private subnet. What we need to do for connecting to the database using PgAdmin or other tool?

We're going to use one of the most common methods for doing this. You will need to launch an Amazon EC2 instance in the public subnet and then use it as jumping box.

So after you have your EC2, you will need to run the following command.
See explantion below

After this, you will need to configure your PgAdmin.
The host name will be your localhost, the port is the same you define in the above command.
Maintenance database will be your DB name and the username you have for connecting.

Hope this helps you connect to your databases.