sábado, 13 de abril de 2013

Playing a Graphic Designer a.k.a Making a banner and youtube logo to a friend

I've been playing around in Illustrator and Photoshop, messing with some types, alignments and images to try to make something useful for a great friend.

That's the result, I hope you like it!

I didn't have the guts with typography contrast here, making "essa" and "vamos" a little boring. 

This one is completely different, a less ludic approach.

quarta-feira, 30 de janeiro de 2013

Tic Tac Toe 3D, Minimax AI

Unity Web Player | WebPlayer

Unity Web Player | WebPlayer

domingo, 13 de maio de 2012

Workshop Desenvolvendo Space Invaders com o Flex SDK - UCL

Eu e meu amigo Vitor de Azevedo demos um workshop de três horas na UCL com o título: "Desenvolvendo Space Invaders com o Flex SDK". Como eu prometi, aqui estão os slides e os códigos exemplo
Quaisquer dúvidas que vocês tiverem não esqueçam de faze-las nos comentários!

segunda-feira, 2 de abril de 2012

Downloading all links from a page

You can use the best part of two worlds (Javascript and Python) to rapidly download all the links from a page. As an example, I'm download all the files from this page http://www.inf.ufes.br/~alberto/proc-par/index.html

First, using chrome, open the Developer Console (Ctrl+Shift+J), now click in Console.

Now, using some js do:

links = document.getElementsByTagName('a');
for(var i=0;i<links.length;i++) { console.log(links[i].href); }


And you should get something like this:
http://www.inf.ufes.br/~alberto/proc-par/programa_processamento_paralelo-2012-1.doc
http://www.inf.ufes.br/~alberto/proc-par/Lista_de_Exercicios_de_Processamento_Paralelo.doc
http://www.inf.ufes.br/~alberto/proc-par/Lista_de_Exercicios_de_Processamento_Paralelo2.doc
http://www.inf.ufes.br/~alberto/proc-par/avaliacao_da_aprendizagem-mestrado.doc
http://www.inf.ufes.br/~alberto/proc-par/aula1.doc
http://www.inf.ufes.br/~alberto/proc-par/aula2.doc
http://www.inf.ufes.br/~alberto/proc-par/aula3.doc
...

Copy and paste it into a python file:

links = """
And you should get something like this:
http://www.inf.ufes.br/~alberto/proc-par/programa_processamento_paralelo-2012-1.doc
http://www.inf.ufes.br/~alberto/proc-par/Lista_de_Exercicios_de_Processamento_Paralelo.doc
http://www.inf.ufes.br/~alberto/proc-par/Lista_de_Exercicios_de_Processamento_Paralelo2.doc
http://www.inf.ufes.br/~alberto/proc-par/avaliacao_da_aprendizagem-mestrado.doc
http://www.inf.ufes.br/~alberto/proc-par/aula1.doc
http://www.inf.ufes.br/~alberto/proc-par/aula2.doc
http://www.inf.ufes.br/~alberto/proc-par/aula3.doc
....
"""

# Finally download the files

import urllib
links = page.split()
for link in links:
   filename = link.split('/')[-1]
   print 'downloading', filename
   urllib.urlretrieve(link, filename)

Result:


>>>
downloading programa_processamento_paralelo-2012-1.doc
downloading Lista_de_Exercicios_de_Processamento_Paralelo.doc
downloading Lista_de_Exercicios_de_Processamento_Paralelo2.doc
downloading avaliacao_da_aprendizagem-mestrado.doc
downloading aula1.doc
downloading aula2.doc
downloading aula3.doc
downloading aula4.doc
downloading aula5.doc
downloading aula6.doc
downloading Cs252s06-lec04-cache-alberto.ppt
downloading Cs252s06-lec07-dynamic-sched-alberto.ppt
downloading Cs252s06-lec08-dynamic-schedB-alberto.ppt
downloading Cs252s06-lec09-limitsSMT-alberto.ppt
downloading L16-Vector-alberto.pptx
downloading L17-VectorII-alberto.pptx
downloading sbac-tutorial-cuda-15.ppt
downloading Slides%20-%20Chapter%203-Alberto.ppt
downloading Slides%20-%20Chapter%204-Alberto.ppt
downloading Slides%20-%20Chapter%205-alberto.ppt
downloading Slides%20-%20Chapter%206-alberto.ppt
downloading Cs252s06-lec12-SMP-alberto.ppt
downloading Cs252s06-lec13-sharedaddress-alberto.ppt
downloading openmp-ntu-vanderpas.pdf
downloading openmp-spec25.pdf
>>>


Remember that it saves the files on where the python script is located.

sexta-feira, 16 de março de 2012

Explorando a mecânica de Diamond Dash e Bejeweled

Pequeno experimento de hoje para fazer um jogo similar a Diamond Dash


Granja Maluca

Modelando inimigos usando Máquinas de Estado.
O uso da função exp para ajuste de dificuldade



quinta-feira, 2 de fevereiro de 2012

Approximating damping calculations using Taylor expansions in physics simulation

I was happily following Game Physics Engine Development Book when I came across the damping approximation. Without any real explanations we got this 2 lines of code:
// Impose drag.
velocity *= real_pow(damping, duration);
An equation that involves a power of t, I freaked out. How is this possible? And then, researching a little about this I tried to understand how to numerical approximate the friction equation F = -cv. Researching more, I started to explore Box2D code, when I finnaly got a reasonable explanation, but still, there was some magical steps. Time to get my calculus books from the shelf.


This can be coded in as3 as:
velocity.scaleBy(1 - damping*duration);

It's always nice when you have the opportunity to use the stuff you learned in your undergrad course. I still don't understand the power of t thing, but I can accept this solution.