Showing posts with label Animasi. Show all posts
Showing posts with label Animasi. Show all posts

Battle Of Surabaya : Film Animasi Sejarah Buatan Anak Indonesia

1:08 PM | , ,



Film Layar Lebar Animasi 2D Pertama Indonesia Battle of Surabaya menceritakan petualangan MUSA, remaja tukang semir sepatu yg menjadi kurir bagi pejuang arek2 Suroboyo & TKR dlm pertempuran dahsyat 10 November 1945 Surabaya.

Cerita dibuka dengan visualisasi dahsyat dari pemboman kota Hiroshima oleh Sekutu yang menandakan menyerahnya Jepang. "Indonesia merdeka, itu yang kudengar di RRI, Jepang menyerah!!" kata Musa. Tetapi langit Surabaya kembali merah dengan peristiwa Insiden Bendera dan kedatangan Sekutu yang ditumpangi oleh Belanda. Belum lagi gangguan oleh beberapa kelompok pemuda Kipas Hitam yang dilawan oleh Pemuda Republiken. Residen Sudirman, Gubernur Suryo, Pak Moestopo, Bung Tomo dan tokoh-tokoh lain membangkitkan semangat arek-arek Suroboyo & pemuda Indonesia bangkit melawan penjajahan.

Cerita ini merupakan cerita adaptasi dari peristiwa 10 November 1945 di Surabaya. Selain tokoh-tokoh nyata, terdapat tokoh fiktif yang sengaja dibuat untuk memperkuat pesan yang ingin disampaikan. Pesan perang tentang semangat, cinta tanah air, dan perdamaian. 



Selamat menonton ^_^



Kunjungi http://battleofsurabayathemovie.com/ untuk mendapatkan info lebih lanjut atau Facebook Fans Page-nya di http://www.facebook.com/BattleOfSurabayaTheMovie
Read More

Animation With Java

10:44 PM | , , , , ,

Hi guys.. How are you ? Did you read my article about how to make a graphic2D in java ? 
How is it ? It's amazing , isn't t ? hehehe :D
Now we will study about how to make an animation with java. Let's we start it....




















package animasiq;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.JPanel;
import sun.java2d.loops.FillRect;

public class Animasi extends JPanel {
Ball ball;
Player1 alir;
Tree tree;
public Animasi() {
setPreferredSize(new Dimension(800, 600));
addMouseListener(new ClickDetector(this));
tree=new Tree(600, 200);
ball = new Ball(0, 450);
alir=new Player1(-100, 350);
alir.nextX=390-alir.getwidth();
Thread t = new Thread(new Runnable() {
public void run() {
while(true) {
alir.update();
ball.update();
ball.nextX = alir.x + alir.getwidth() +5 ;
if(ball.nextY<=460) ball.nextY+=2; else ball.nextY-=2;
repaint();
try {
if(ball.x>=430){
Thread.sleep(400);
}else{
Thread.sleep(200);
}
} catch (InterruptedException ex) {}
}
}
});
t.start();
}

@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D gd = (Graphics2D) g;
gd.setColor(Color.BLUE);
gd.fillRect(0, 0, 800, 400);
gd.setColor(Color.GREEN);
gd.fillRect(0, 400, 800, 400);
gd.setColor(Color.BLACK);
gd.fillRect(0, 390, 800, 30);
gd.setFont(new Font("Times New Roman", 1, 24));
gd.setColor(Color.WHITE);
gd.drawString("Created By Alir", 100, 300);
tree.drawTree(gd);
alir.drawBall(gd);
ball.drawBall(gd);
System.out.println(ball.x+" "+ball.y);
gd.dispose();
}

class ClickDetector extends MouseAdapter {
Animasi parent;

public ClickDetector(Animasi parent) {
this.parent = parent;
}

@Override
public void mouseClicked(MouseEvent e) {
super.mouseClicked(e);
parent.alir.nextX=e.getX();
}
}

class Ball {
public BufferedImage image;
public int x, y;
public int nextX, nextY;
public int scale=40;

public Ball(int x, int y) {
this.x = x;
this.y = y;
nextX = x;
nextY = y;
try {
image = ImageIO.read(getClass().getResource("ball.png"));
} catch (IOException ex) {}
}

public void drawBall(Graphics2D gd) {
Image gambar = null;
Image ori=image;
gambar= ori.getScaledInstance(this.scale , -1, Image.SCALE_SMOOTH);
gd.drawImage(gambar, x, y, null);
}

public void growthBall(Graphics2D gd) {
Image gambar = null;
try {
Image ori=image;
gambar= ori.getScaledInstance(this.scale , -1, Image.SCALE_SMOOTH);
gd.drawImage(gambar, x, y, null);
this.scale+=10;
} catch (Exception ex) {
System.out.println("SALAH");
}
}
public void update() {
if (x != nextX) {
if(ball.x>430){
x = x > nextX ? x - 40 : x + 30;
}else{
x = x > nextX ? x - 20 : x + 20;
}
}
if (y != nextY) {
y = y > nextY ? y - 5 : y + 5;
}
}
}
class Tree {
public BufferedImage image;
public int x, y;
public int nextX, nextY;
public int scale=40;

public Tree(int x, int y) {
this.x = x;
this.y = y;
nextX = x;
nextY = y;
try {
image = ImageIO.read(getClass().getResource("pohon.png"));
} catch (IOException ex) {}
}

public void drawTree(Graphics2D gd) {
Image gambar = null;
Image ori=image;
gambar= ori.getScaledInstance(150 , -1, Image.SCALE_SMOOTH);
gd.drawImage(gambar, x, y, null);
}
public void update() {
x = x < 100 ? 0 : x - 30;
}
}
class Player1{
public BufferedImage image;
public int x, y;
public int nextX, nextY;
public String gbr[]={"Kanan.png","Kiri.png"};
public int posisi=0;
public boolean stop=false;

public Player1() {
this.x=0;
this.y=300;
}

public Player1(int x, int y) {
this.x = x;
this.y = y;
nextX = x;
nextY = y;
if(!stop){
if(this.posisi==0) this.posisi=1; else this.posisi=0;
}
try {
image = ImageIO.read(getClass().getResource(this.gbr[this.posisi]));
} catch (IOException ex) {}
}
public int getwidth(){
return image.getWidth();
}
public void drawBall(Graphics2D gd) {
if(!stop){
if(this.posisi==0) this.posisi=1; else this.posisi=0;
}
try {
image = ImageIO.read(getClass().getResource(this.gbr[this.posisi]));
} catch (IOException ex) {}
gd.drawImage(image, x, y, null);
}

public void update() {
if(!stop){
if (x != nextX) {
x = x > nextX ? x - 10 : x + 10;
}
if (y != nextY) {
y = y > nextY ? y - 1 : y + 1;
}
}
}
}
}

Here is The Source .
Read More