61 Forum Posts by "AI-Anarki"
This is a tutorial.
You need to know about Applets in Java. Including how to execute and view them.
You must have intermediate Java programming skills.
Ok good.
I am assuming you know how classes work when using the Applet extension, I am going into deeper detail of the methods in the applet package.
import java.applet.*;
import java.awt.*;
Basic stuff, importing applet as well as graphic classes.
public class someClass extends Applet implements Runnable{}
You should understand the class and extends syntax. Implement Runnable basically tells Java that you will be using a run() method to execute loops, like in games and aniation done through API.
public void init(){}
This executes whatever is in the curly braces when the Applet has loaded, including pictures, objects and variables.
public void start(){
Thread someThread = new Thread();
someThread.start();
}
In the start method usually any Thread objects are initialized. Threads are lines of programming and in this case there is only one, so don't worry too much about it.
public void paint(Graphics g){
g.setColor(Color.Red); //Damn americans! everyone knows its Colour not Color...
g.fillRect(0,0,100,100);
}
The paint method uses graphics to draw whatever you have told it to draw. In this case it's a red rectangle 100 px wide and 100 px high.
public void run(){
Thread.currentThread().setPriority(Threa d.MIN_PRIORITY);
while(true){
repaint();
try{
Thread.sleep(100);
}catch(Intercept Exception ex){}
Thread.currentThread().setPriority(Threa d.MAX_PRIORITY);
}
}
Ok here is the tricky part. Java was called to run this method (run()) and it has a loop in it. The while loop is infinite since it isn't checking for anything whatsoever. repaint() calls the paint method to redraw graphics (I may cover Double Buffering in later tutorials). Thread.sleep(100) tells the current thread to stop for 100 milliseconds. It has to be in a try syntax or else Java gives you all sorts of exception errors.
Heres an example program:
import java.applet.*;
import java.awt.*;
public class someClass extends Applet implements Runnable{
int xpos = 100;
int ypos = 100;
public void init(){}
public void start(){
Thread someThread = new Thread();
someThread.start();
}
public void paint(){
g.setColor(Color.red);
g.fillOval(xpos,ypos,10,10);
}
public void run(){
Thread.currentThread().setPriority(Threa d.MIN_PRIORITY);
while(true){
repaint();
try{
someThread.sleep(100);
}catch(InterruptedException ex){}
Thread.currentThread().setPriority(Threa d.MAX_PRIORITY);
}
}
Open up JCreator (Xinox Software) or whatever you use, copy-paste, create class, create HTML Applet around 500 by 500 and voila! you will have a red circle updating itself 100 ms.
I'll write a tut on basic Applet usage e.g Drawing API and Images onscreen and some basic methods in the applet package
Let go of your mouse when you're fapping
Unless he advertises his laptops names on a network as 'Stolen Laptop Haxxorz please dont trace'
Off topic but still.... 3d in flash is possible and at times even feasible, but saying this if you do have the skills and knowledge of how to make 3d vector processing then you are a bit advanced to be using such a low level language as Actionscript... my rant sorry...
And dont used buttons for targets, theyre gay and belong on menus
Use movieclips they can behave like buttons using the on(press) or on(release) syntax
Uhhh... basically you should do API hitTesting...
if(_xmouse > leftofareawhereyoucantdraw && _ymouse > topofareawhereyoucantdraw){
canDraw = false;
}else{
canDraw = true;
}
voila!
I hate fat people.
They're useless.
Why would you want to be fat? it's harder to do things and therefore you are less of an asset to the human race and you should go jump in a pit of spikes like the homosexuals
there's my rants any questions and I'll answer...
Well you must realise that what you are suggesting is more complex than it seems...
I assume you are using trig. movement e.g
ball._x += Math.sin(ball._rotation*Math.PI/180) * speed
ball._y += Math.cos(ball._rotation*Math.PI/180) * speed
once thats done you need to use physics to find the theta of the balls incidence angle and the theta of the reflective angle. But I'll let you look that up for yourself :P
Do you actually want to get rid of the MC or just clear it...
if you want to clear it just use clear()
Wow this is looking great! I would so pay to sponsor this! I can just think of the storyline now...
A stick is lonely so he decides to dance and the world randomly dissapears and is replaced by epileptic lines.... And he loses his neck somewhere?
[/sarcasm] btw
Sigh... I hate copy and paste noobs...
Anyway if you're willing to write your own code here's a tip:
You'll need a seperate variable for your characters direction
e.g.
if(key.isDown(Key.LEFT)){
characterDirection = "left"
player._x-=10
}
if(characterDirection == "left"){
player.gotoAndStop("left")
}
Oh god... Dress up games and mouse collision games are the laziest and most pointless games
Other than the fact that dress up games can be artisitic there is no complex programming invovled...
Just like mouse avoiders, I mean come on a few hitTests here and there. And don't say 'yeah well v-cams make it look cool!' its lazy
How can you make it so your text skips lines at runtime (like return key)
// HIT RIGHT
if(wall.hitTest(player._x+player._width/2,pla yer._y,true)){
do stuff....
}
// HIT LEFT
if(wall.hitTest(player._x-player._width/2,pla yer._y,true)){
do stuff....
}
Thats a noobish version... learn to do tile engines and skip hitTest altogether
Is this using a tiulebased engine? it is really slow you need some kind of engine to load the map... even without the blur it will lag...
You need to learn how to make tiled platformers and realistic.... everything...
I was thinking about makin a pac-man clone, but then I saw all the remakes there are on newgrounds alone...
My friend suggested paintball... What do you think?
I'm making an engine for an Isometric game, I just need an idea for what to make it about...
Any ideas?
I dont know.... Its a toss up between time control and telekenisis...
But it makes me, ask in movie (e.g Xmen), why do people with telekenisis mind control weapons when you could just as easily tear all the bodily organs, blood and or bones out of someon...
just a thought
See we wouldnt have this problem if all guys had metre long dicks.... we could just stand there and pump it out while its over the seat....
I would know >.> <.<
Uhh a few things...
Your mouselook is a little off it looks stingy, make sure everything is aligned right
And to make your bullets come out from the top of the turret, you need to fully understand sin +cos... or just steal from a tutorial like everyelse
Hm spore in flash?
even using AS3 this is going to be a massive challenge, I'm guessing you want to be able to compare it to the ps3 version... will it be 3d?
No it isnt.... Its a beaver with bannanas on its face...
if(_root.whatever.hitTest(_root.player._x,_ro ot.player._y,true)){
blah blah
}
Ive layed sooooo many games like this.... just like making another snake game :(
Also almost all the effects in it (e.g gravity) looks exactly like the gravity from a tutorial ive seen...
bsides that good luck!
Rebounding of angles is much more complex... its called inverse kinematics
it is using sin. and cos. so if you're blank onyour trig. you're kinda screwed
Use function()s
so instead of onClipEvent(enterFrame) use onEnterFrame = function(){ blah blah}
P.S all in timeline
P.P.S vars in timeline out of enterframe func.
Well im bored so..... heres a really nooby one....
if(_root.enemy._x > _root.player._x){
_root.enemy._x--;
}
if(_root.enemy._x < _root.player._x){
_root.enemy._x++;
}
and repeat for _y when necessary

