View Single Post
  #5 (permalink)  
Old 01-08-2008, 05:17 AM
BlitzA BlitzA is offline
Member
 
Join Date: Dec 2007
Posts: 11
BlitzA is on a distinguished road
Ok that looks pretty good. I don't understand how that all works though.. like I said I'm new to java.

I'll have to see if I can study it.

this is what i've came up with lol.

Code:
import java.awt.Color; import element.*; public class Hyduken { public static void pause(long waitTime) { long startTime = System.currentTimeMillis(); long stopTime = startTime + waitTime; while( System.currentTimeMillis() < stopTime) { //nothing goes here - meaning do nothing } } public static void main ( String[] Args ) { int x = 650; int y = 500; int x3 = 650; int y3 = 500; int x2 = 650; int y2 = 500; int degreestart = 100; int degreeend = 100; int degreestart2 = 100; int degreeend2 = 100; DrawingWindow dWin = new DrawingWindow( 1000, 1000 ); Rect Background = new Rect ( 0, 0, 1000, 1000 ); dWin.setForeground( Color.black ); dWin.draw( Background ); dWin.fill( Background ); while( x > 580) { dWin.setForeground( Color.blue ); Arc Arc1 = new Arc( x2-50, y2-50, 80, 80, degreestart -10, degreeend +80 ); dWin.fill( Arc1 ); dWin.setForeground( Color.gray ); Arc Arc2 = new Arc( x2-50, y2-50, 80, 80, degreestart2-190, degreeend2 +80 ); dWin.fill( Arc2 ); dWin.setForeground( Color.blue ); Oval Oval1 = new Oval( x-30, y-50, 41, 41 ); dWin.fill( Oval1 ); dWin.setForeground( Color.gray ); Oval Oval2 = new Oval( x3-30, y3-11, 41, 41 ); dWin.fill( Oval2 ); x-=14; y+=1; x3-=8; y3-=1; x2-=11; degreestart +=10; degreestart2 +=10; pause(300); dWin.hold(); dWin.setForeground( Color.black ); dWin.fill( Oval1 ); dWin.fill( Oval2 ); dWin.fill( Arc1 ); dWin.fill( Arc2 ); dWin.release(); } while( x > 545 ) { dWin.setForeground( Color.blue ); Arc Arc3 = new Arc( x2-50, y2-50, 80, 80, degreestart -10, degreeend +80 ); dWin.fill( Arc3 ); dWin.setForeground( Color.gray ); Arc Arc4 = new Arc( x2-50, y2-50, 80, 80, degreestart2-190, degreeend2 +80 ); dWin.fill( Arc4 ); dWin.setForeground( Color.blue ); Oval Oval3 = new Oval( x-30, y-50, 41, 41 ); dWin.fill( Oval3 ); dWin.setForeground( Color.gray ); Oval Oval4 = new Oval( x3-30, y3-11, 41, 41 ); dWin.fill( Oval4 ); x-=14; y+=5; x3-=11; y3-=3; x2-=12; degreestart +=10; degreestart2 +=10; pause(300); dWin.hold(); dWin.setForeground( Color.black ); dWin.fill( Oval3 ); dWin.fill( Oval4 ); dWin.fill( Arc3 ); dWin.fill( Arc4 ); dWin.release(); } while( x > 500 ) { dWin.setForeground( Color.blue ); Arc Arc5 = new Arc( x2-50, y2-50, 80, 80, degreestart -10, degreeend +80 ); dWin.fill( Arc5 ); dWin.setForeground( Color.gray ); Arc Arc6 = new Arc( x2-50, y2-50, 80, 80, degreestart2-190, degreeend2 +80 ); dWin.fill( Arc6 ); dWin.setForeground( Color.blue ); Oval Oval5 = new Oval( x-30, y-50, 41, 41 ); dWin.fill( Oval5 ); dWin.setForeground( Color.gray ); Oval Oval6 = new Oval( x3-30, y3-11, 41, 41 ); dWin.fill( Oval6 ); x-=10; y+=3; x3-=10; y3-=2; x2-=11; degreestart +=10; degreestart2 +=10; pause(300); dWin.hold(); dWin.setForeground( Color.black ); dWin.fill( Oval5 ); dWin.fill( Oval6 ); dWin.fill( Arc5 ); dWin.fill( Arc6 ); dWin.release(); } } }
Reply With Quote