Spring Break Mid-Point

An edit to the title screen:

Title Screen

Created 2 types of bullets, one that changes its angle twice while traveling, and one that changes speed once after a given amount of time.

Here’s the angle changing bullet:

Angle Changing bullets

I figured I could simulate bullet splitting by having two bullets fired in the same direction, then just have them change to different angles. It’s fun playing around with the angles and timings of the angle changes, and what pattern the bullets were originally fired in. A couple of small changes makes something like this instead:

High Turning Speed

I just realized this editor has code tags.. I’ll give it a try. The angle-changing bullet code looks something like this..

package STG.shot;

import com.jme3.export.JmeExporter;
import com.jme3.export.JmeImporter;
import com.jme3.math.FastMath;
import com.jme3.math.Vector3f;
import com.jme3.renderer.RenderManager;
import com.jme3.scene.Spatial;
import com.jme3.scene.control.Control;
import com.jme3.renderer.ViewPort;
import java.io.IOException;

public class UncannySealShot extends StraightShot {
float lifetime = 0;
float bendTime1 = 2;
float bendTime2 = 4;
int bends = 0;
float bendAngle1 = 0.2f;
float bendAngle2 = 0.2f;
boolean rightward = false;
//False = left, true = right

public UncannySealShot(Spatial spatial, Vector3f src, Vector3f dir, float speed, float t1, float t2, float d1, float d2, boolean right) {
super(spatial,src,dir,speed);
bendTime1 = t1;
bendTime2 = t2;
bendAngle1 = d1;
bendAngle2 = d2;
rightward = right;
}

public void setTarget(Vector3f targ) {
direction.set(targ.subtract(spatial.getLocalTranslation()));
}
public void setDirection(Vector3f dir) {
direction.set(dir);
}

public void setPause(boolean pause) {
paused = pause;
}

public Control cloneForSpatial(Spatial spatial) {
throw new UnsupportedOperationException("Not supported yet.");
}

public void setSpatial(Spatial spatial) {
this.spatial = spatial;
}

public void setEnabled(boolean enabled) {
throw new UnsupportedOperationException("Not supported yet.");
}

public boolean isEnabled() {
throw new UnsupportedOperationException("Not supported yet.");
}

public void update(float tpf) {
if(!paused) {
lifetime += tpf;
if(lifetime > bendTime1 && bends bendTime2 && bends < 2) {
bend();
bends++;
}
spatial.move(velocity.mult(tpf));
}
}

private void bend() {
if(rightward) {
if(bends < 1) {
angle += bendAngle1;
} else {
angle += bendAngle2;
}
} else {
if(bends < 1) {
angle -= bendAngle1;
} else {
angle -= bendAngle2;
}
}
float x = FastMath.cos(angle);
float y = FastMath.sin(angle);
if(rightward) {
direction.set(direction.add(x,y,0).normalize());
} else {
direction.set(direction.subtract(x,y,0).normalize());
}
velocity = direction.mult(speed);
spatial.rotate(0,0,-angle);
}

public void render(RenderManager rm, ViewPort vp) {
}

public void write(JmeExporter ex) throws IOException {
throw new UnsupportedOperationException("Not supported yet.");
}

public void read(JmeImporter im) throws IOException {
throw new UnsupportedOperationException("Not supported yet.");
}
}

I eventually want to release all of the game as open source, but it’s so unwieldy that I’m having doubts that it will serve a purpose to anyone.

Here’s one of Alice’s spell cards, it’s simple. It’s just two familiars set to swing back and forth in front of the character, and the familiars shoot bullet rings at an offset that’s incremented at each firing.

Second Non-card? I forgot what qualifies things as non-cards

I’m also trying to solidify the gameplay idea, so here it is with a little change: Dodge/graze bullets, build up energy, fire shots, shots can destroy bullets and damages the enemy’s life, repeat until you win. I changed it so that player shots destroy bullets today. I’m not sure if it was a good idea but I like it for now.

Coincidentally, this pic also shows the speed-changing bullet. It’s the red ones, they move fast, then slow down and clump up. If you can deal with it you’d stay lower down to build up energy, otherwise it might be easier to dodge higher up.

Destroying Bullets

Here’s another card I worked on today:

Spell 1

Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s