Skip to content

Instantly share code, notes, and snippets.

@Dirga36
Last active January 10, 2026 12:29
Show Gist options
  • Select an option

  • Save Dirga36/974ea1b3e2a5e807dbd0534bd98934fd to your computer and use it in GitHub Desktop.

Select an option

Save Dirga36/974ea1b3e2a5e807dbd0534bd98934fd to your computer and use it in GitHub Desktop.
cax
cax = new DoodleUnitType("cax") {{
constructor = TankUnit::create;
aiController = GroundAI::new;
//attributes
hitSize = 50f;
treadPullOffset = 1;
speed = 0.7f;
health = 17000;
armor = 30f;
crushDamage = 25f / 5f;
rotateSpeed = 1f;
range = 500f;
//tread trail effect
treadRects = new Rect[]{new Rect(17, 333 , 60, 70), new Rect(157, 333 , 60, 70)};
//main weapon
weapons.add(new Weapon("doodle-tank-mod-cax-weapon") {{
shootSound = DoodleSounds.mediumCannon;
layerOffset = 0.1f;
reload = 100f;
shootY = 32.5f;
shake = 5f;
recoil = 0f;
rotate = true;
rotateSpeed = 0.6f;
mirror = false;
x = 0f;
y = 7f;
shadow = 50f;
cooldownTime = 110f;
parts.addAll(
new RegionPart("-suspension-barrel") {{
progress = PartProgress.recoil;
mirror = false;
under = true;
moveY = -5f; //
}}
);
bullet = new BasicBulletType(15f, 400f) {{
sprite = "missile-large";
width = 12f;
height = 20f;
lifetime = 90f;
hitSize = 6f;
smokeEffect = Fx.shootSmokeTitan; //is this the muzzle flash handler?
pierceCap = 3;
pierce = true;
pierceBuilding = true;
hitColor = backColor = trailColor = Color.valueOf("feb380");
frontColor = Color.white;
trailWidth = 4f;
trailLength = 9;
hitEffect = despawnEffect = Fx.massiveExplosion;
despawnSound = DoodleSounds.dullExplosion;
shootEffect = new ExplosionEffect() {{
lifetime = 40f;
waveStroke = 4f;
waveColor = sparkColor = trailColor;
waveRad = 15f;
smokeSize = 5f;
smokes = 8;
smokeSizeBase = 0f;
smokeColor = trailColor;
sparks = 8;
sparkRad = 40f;
sparkLen = 4f;
sparkStroke = 3f;
}};
splashDamage = 65f;
splashDamageRadius = 70f;
despawnEffect = new ExplosionEffect() {{
lifetime = 50f;
waveStroke = 4f;
waveColor = sparkColor = trailColor;
waveRad = 30f;
smokeSize = 7f;
smokes = 6;
smokeSizeBase = 0f;
smokeColor = trailColor;
sparks = 5;
sparkRad = 30f;
sparkLen = 3f;
sparkStroke = 1.5f;
}};
}};
}});
//secondary weapon (WIP)
weapons.add(new Weapon("doodle-tank-mod-cax-point-weapon") {{
shootSound = DoodleSounds.pew;
reload = 5f;
x = 5f;
y = 14f;
shootY = 5.5f;
recoil = 0f;
rotate = false;
mirror = false;
bullet = new BasicBulletType(4.5f, 25) {{
width = 6.5f;
height = 11f;
shootEffect = Fx.sparkShoot;
hitColor = backColor = trailColor = Color.valueOf("feb380");
frontColor = Color.white;
trailWidth = 1.5f;
trailLength = 4;
hitEffect = despawnEffect = Fx.hitBulletColor;
}};
}});
}};
@Dirga36
Copy link
Copy Markdown
Author

Dirga36 commented Jan 10, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment