8 January, 2012 - 2:17 am
Tags: 1 year, Pixelart, Silveira, suyane
Posted in english | Comments Off
8 October, 2011 - 6:38 pm
Tags: flatten, lists, programming, Python
Posted in english | 1 comment
Surprisingly python doesn’t have a shortcut for flatten a list (more generally a list of lists of lists of…). I made a simple implementation that doesn’t use recursion and tries to be written clearly. I get a element from a “bad” list (a list that can have another lists). If the element is not a [...]
/** * Openpixels example in Processing. * This simple example of how to get a sprite * from a sprite sheet. */ PImage bg; PImage sprite_sheet; PImage player; void setup() { // load images bg = loadImage("kitchen.png"); sprite_sheet = loadImage("guy.png"); /* The sprite size is 32×49. Look guy.png, the "stand position" is [...]
This was a project that me and Marco Diego created during our graduation for the Computer Graphics course. It is a ray tracing engine build from scratch in C. It was great exercise of experimentation on how implement object-oriented design patterns in ANSI C. Later Marco continued it in his master’s degree thesis implementing more [...]
2 June, 2011 - 5:27 pm
Tags: clouds, HTML5, JavaScript, Pixelart
Posted in english | 6 comments
If you are reading this text, sorry, your browser don’t support HTML5 Canvas (or maybe I did something wrong). var canvas;var ctx;var background;var width=300;var height=200;var cloud;var cloud_x;function init(){canvas=document.getElementById(“cloud_demo_canvas”);width=canvas.width;height=canvas.height;ctx=canvas.getContext(“2d”);background=new Image();background.src=’http://silveiraneto.net/wp-content/uploads/2011/06/forest.png’;cloud=new Image();cloud.src=’http://silveiraneto.net/wp-content/uploads/2011/06/cloud.png’;cloud.onload=function(){cloud_x=-cloud.width};return setInterval(main_loop,10)}function update(){cloud_x+=0.3;if(cloud_x>width){cloud_x=-cloud.width}}function draw(){ctx.drawImage(background,0,0);ctx.drawImage(cloud,cloud_x,0)}function main_loop(){draw();update()}init(); Code: var canvas; var ctx; var background; var width = 300; var height = 200; var cloud; var cloud_x; [...]
Context ctx = getContext(); Display display = ((WindowManager)ctx.getSystemService(ctx.WINDOW_SERVICE)).getDefaultDisplay(); int width = display.getWidth(); int height = display.getHeight(); Yes, there are easier ways to retrieve the screen width on Android but there are cases that this long code is the only solution. You may already have the Context. WindowManager or the Display and so it would be [...]
9 March, 2011 - 12:52 pm
Tags: array, array_shift, PHP, programming
Posted in english | No comments
$bric = array("Brazil", "Russia", "India", "China"); $ric = $bric; // array copy $br = array_shift($ric); // left shift at $ric. $br stores "Brazil" print_r($bric); // $bric remains the same print_r($ric); // $ric lost "Brazil" Output: Array ( [0] => Brazil [1] => Russia [2] => India [3] => China ) Array ( [0] => Russia [...]
As the big subject now is soccer world cup, the main brazilian team uniform is now available on the project. Here a example of character: Gimp source file: open_chars.xcf
29 April, 2010 - 10:29 am
Tags: Class, Java, method, programming, Reflection
Posted in english | 2 comments
import java.lang.reflect.*; public class Foo { public void bar(int param){ System.out.println(param); } public static void main(String args[]){ Object f = new Foo(); try { Method m = f.getClass().getMethod("bar", int.class); m.invoke(f, 42); } catch (Exception e){ System.err.println(e); } } } $ java Foo 42
22 April, 2010 - 1:33 pm
Tags: agile, art, arte, Atlântico, fikdik, pixel art, Pixelart, post-its, SEMC, space invaders
Posted in português | No comments
Sem dúvida os post-its nos tornam mais ágeis e são indispensáveis para metodologias que fazem uso de dashboards como Scrum. Mas o que fazer com as toneladas de post-its que são gerados e descartados? E o impacto ambiental? E o meio ambiente? E as araras-azuis? Eis minha intervenção artística no escritório. Bug Invaders (sugestão de [...]
1 July, 2011 - 3:39 pm
wnana hwa lippy supa