Skip to content

Commit

Permalink
Improve talking, add random battles, add multiple enemies per battle
Browse files Browse the repository at this point in the history
Add ridiculous shader
  • Loading branch information
SgtCoDFish committed Aug 25, 2014
1 parent 6c5e78b commit 6c5dc80
Show file tree
Hide file tree
Showing 18 changed files with 496 additions and 90 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ local.properties
.externalToolBuilders/
*.launch

.README.md.html

## NetBeans
**/nbproject/private/
build/
Expand Down
4 changes: 3 additions & 1 deletion core/assets/maps/world1/npc/npc1.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
I'm an old man.
Me?
Oh! There's nothing interesting about me...
Along you go...
5 changes: 4 additions & 1 deletion core/assets/maps/world1/npc/npc2.txt
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
I'm a king.
Ahh hello there Valiant Hero�!
Although, saying that, your hair is not that of a hero... hopefully that will change, yes?
I was wondering if you could help us with a little problem...
The Wizard Knowall on the lake should be able to fill you in on the details.
4 changes: 3 additions & 1 deletion core/assets/maps/world1/npc/npc3.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
I'm a queen.
Here, let me tend to your wounds...
...
All better! I hope I see you again soon!
3 changes: 2 additions & 1 deletion core/assets/maps/world1/npc/npc4.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Oh, you're awake!
No, it's not weird that I stood over your unconscious body instead of taking you to a hospital...
Anyway, you just kinda appeared here, so you should probably go and talk to someone old and wise.
Anyway, you just kinda appeared here, so you should probably go and talk to someone old and wise.
Like the king to the east!
11 changes: 10 additions & 1 deletion core/assets/maps/world1/npc/npc5.txt
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
I'm a wizard.
The King Allmight sent you did he?
We need your help opening a strange door in our world...
It is said that mighty foes in other, connected, worlds must be slain to empty it...
I believe you have THE POWER to change your world.
Why you? Because you're the playable character, that's why!
You may press [ENTER] to choose an adjacent world to our own!
Before you leave, you may wish to train in the slime pen to the south!
If you need healing, I am sure the queen will, urm, see to you...
Once you have slain all 5 all powerful world bosses...
Return to this world and see what lies beyond the door!
8 changes: 8 additions & 0 deletions core/assets/shaders/passVertex.glslv
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
attribute vec4 a_position; attribute vec4 a_color; attribute vec2 a_texCoord0;
uniform mat4 u_projTrans;
uniform vec3 iResolution;
uniform sampler2D u_texture;
uniform float vortexFlag;
uniform float transitionTime;
uniform float expectedTransitionTime;
varying vec4 v_color; varying vec2 v_texCoords; void main() { v_color = a_color; v_color.a = v_color.a * (256.0/255.0); v_texCoords = a_texCoord0; gl_Position = u_projTrans * a_position; };
Expand Down
75 changes: 75 additions & 0 deletions core/assets/shaders/vortexFragment.glslf
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/* This shader is derived from shaders on shadertoy.com, which supply no licesning information and thus fall under the below license:
* This shader is licensed under the creative commons Attribution-NonCommercial-ShareAlike 3.0 Unported license.
*
* For more details see the LICENSE file.
* The original shaders can be found at
* https://www.shadertoy.com/view/Xdl3WH
* https://www.shadertoy.com/view/MdXGzr
*/

#ifdef GL_ES
#define LOWP lowp
precision mediump float;
#else
#define LOWP
#endif

#define PI 3.1416
#define WAVE_SIZE 0.5
#define SPEED 4.0

varying LOWP vec4 v_color;
varying vec2 v_texCoords;

uniform vec2 iResolution;
uniform sampler2D u_texture;
uniform float vortexFlag;
uniform float transitionTime;
uniform float expectedTransitionTime;

void main() {
if(vortexFlag > 0.5) {
/*
vec2 p = (2.0 * gl_FragCoord.xy / iResolution.xy - 1.0)
* vec2(iResolution.x / iResolution.y, 1.0);
vec2 uv = vec2(atan(p.y, p.x) * 1.0/PI, 1.0 / sqrt(dot(p, p))) * vec2(2.0, 1.0);
uv.x += sin(2.0 * uv.y + transitionTime * 60.0);
vec3 c = texture2D(u_texture, uv).xyz / (uv.y * 0.5 + 1.0);
float mod = transitionTime * 20.0;
gl_FragColor = vec4(c/mod, 1.0);
*/
vec2 rcpResolution = 1.0 / iResolution.xy;
vec2 uv = gl_FragCoord.xy * rcpResolution;

vec4 mouseNDC = -1.0 + vec4(0.5, 0.5, uv) * 2.0;
vec2 diff = mouseNDC.zw - mouseNDC.xy;

float dist = length(diff);
float angle = PI * dist * WAVE_SIZE + transitionTime * SPEED;

vec3 sincos;
sincos.x = sin(angle);
sincos.y = cos(angle);
sincos.z = -sincos.x;

vec2 newUV;
mouseNDC.zw -= mouseNDC.xy;
newUV.x = dot(mouseNDC.zw, sincos.yz);
newUV.y = dot(mouseNDC.zw, sincos.xy);

vec3 col = texture2D( u_texture, newUV.xy ).xyz;

//float mod = (newUV.y * 0.5 + 1.0) * 1.0/(transitionTime/expectedTransitionTime);

float mod = clamp(iResolution.x/gl_FragCoord.x + iResolution.y/gl_FragCoord.y ,0.01, 0.5);

gl_FragColor = vec4(col*mod, 1);
} else {
gl_FragColor = v_color * texture2D(u_texture, v_texCoords);
}
};
7 changes: 7 additions & 0 deletions core/src/uk/org/ulcompsoc/tesseract/Move.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public enum Type {

public int currentStep;

public final float duration;

public float durationRemaining;
public float stepTime;

Expand All @@ -45,6 +47,7 @@ public Move(Entity mover, Type type, Vector2 start, float nx, float ny, float du
this.currentStep = 0;
this.stepCount = calcStepCount();

this.duration = duration;
this.durationRemaining = duration;
this.stepTime = 0.0f;
this.timePerStep = durationRemaining / (float) this.stepCount;
Expand Down Expand Up @@ -97,6 +100,10 @@ public boolean isDone() {
return durationRemaining <= 0.0f;
}

public boolean isNearlyDone() {
return (3 * durationRemaining < duration);
}

public float getCurrentX() {
return steps[currentStep * 2];
}
Expand Down
Loading

0 comments on commit 6c5dc80

Please sign in to comment.