Tutorial is laggy because I had to create a convoluted code for the triggers.
Pants level: use the drones! Cocktails and other weapons aren't really effective against the pants. The floating disc do help.
The reason that the tutorial is laggy is that you keep loading the images every loop.
In other words you only has to call the 'updateImage()'-method in the constructor.
And you can also just say:
'public void updateImage() {
' setImage("CyanspherespeechTut"+ image +".png");
'}
I assume you are talking about the levitating jeans... To remove it, Use the drones (They are the best against floating targets that are rarely vulnerable to other weapons such as cocktails and bombers.) Floating disc also helps. Deploy the Instant Armor at the middle.
I forgot currently I forgot to add one code that makes the later additions vulnerable to explosions... I will change it and add new levels in the process.
A new version of this scenario was uploaded on Sat May 16 16:04:44 UTC 2009
A new version of this scenario was uploaded on Sat May 16 16:48:12 UTC 2009
Be aware: Stay near the capturable structures to capture it. Currently the captuarble structure is the fuel factory (the structure with smokestack, 2 towers, and a dome), which provides resources in intervals of time. Also, the resource meter works well.
Looks interesting, although slightly confusing.
Maybe the different weapons can be introduced one by one as the game progresses. I have trouble using them all (or even knowing what they are and what they do.)
Okay, so I looked at your source, and your act() methods are all pretty long.... which contributes to lag. However, for something like this:
if(frame > 4)
{
frame = 1;
}
if(frame == 1)
{
setImage(frame1);
}
if(frame == 2)
{
setImage(frame3);
}
etc.
You can use a switch method to make sure the computer doesn't go checking through all 5. Switch would be like this:
switch (frame)
case 1: doThis(); break;
case 1: doThis(); break;
case 2: doThis(); break;
case 3: doThis(); break;
case 4: doThis(); break;
default: doThis(); break;
}
For the switch, the computer takes the number you input into the parenthesis, and goes to the case associated it. This would be faster than your original code, which checked if the number equals 1, and then checked if it equals 2; basically, the computer just does the searching for the number once in the switch. So basically, try to cut down on the amount of things the computer does.
Wow, I never thought I'd see the day where I wished for a find feature in the class hierachy... that's possibly the most I've ever seen! Are they all being used? With regards to the lag, is that on the level with the smoke particles?
As an aside, you could do with cleaning up some of your code a bit so it's more conventional - starting all class names in upper case, variables in lower case, making your fields private rather than public and that sort of thing.
I use all the classes. The reason that I use public variable is because almost all require interaction from other objects and thus are subject to change (meaning I cannot use private variables or have to go through overhauling it) Smoke particles do not cause such lag, but many objects do cause lag.
I think i found the problem. When the babies fall from the sky, the game lags, and i think this part of the code in the suicidebaby class has to do with it:
platform vipr = (platform) getOneObjectAtOffset(0, (getImage().getHeight()/2), platform.class);
if(vipr == null)
{
setImage("suicidebabyparatroop.png");
setLocation(getX(), getY() + 1);
}
if(vipr != null)
{
setImage("suicidebaby.png");
parachute = false;
}
That was found in the act method, so basically, when the baby is falling, the computer continuously assigns it the same image. So maybe you can have some type of initialization to set the parachute image first so that it isn't set continuously.
So this is my modification of the code:
public suicidebaby(boolean ini)
{
parachute = ini;
hitpoints = 300;
if (parachute) {
setImage("suicidebabyparatroop.png");
}
}
...
else if(parachute == true)
{
platform vipr = (platform) getOneObjectAtOffset(0, (getImage().getHeight()/2), platform.class);
if(vipr == null)
{
setLocation(getX(), getY() + 1);
}
if(vipr != null)
{
setImage("suicidebaby.png");
parachute = false;
}
}
So basically, the initialization of the suicidebaby class takes care of the image, and later, the computer does not continuously set the image as the parachute thing., but sets the landing image when the baby has landed.
A new version of this scenario was uploaded on Wed Jul 11 21:07:06 UTC 2012
Minor patch
-The Penultimate stage no longer lags
-Units can go out of bound, and if Cyan Sphere falls too much, the stage will be reset as if he has fallen.
2009/5/3
2009/5/4
2009/5/4
2009/5/4
2009/5/4
2009/5/4
2009/5/4
2009/5/4
2009/5/6
2009/5/7
2009/5/8
2009/5/9
2009/5/9
2009/5/11
2009/5/17
2009/5/20
2009/5/20
2009/5/21
2009/6/4
2009/6/7
2009/6/8
2009/6/8
2009/6/9
2009/6/10
2009/6/17
2009/6/18
2009/6/18
2009/6/18
2009/6/18
2009/6/18
2009/6/18
2009/6/18
2009/6/19
2009/7/29
2009/12/4
2009/12/13