Merge branch 'main' into new-editors
This commit is contained in:
+14
-10
@@ -1,39 +1,43 @@
|
||||
var fastCarCanDrive:Bool = true;
|
||||
|
||||
function create() {
|
||||
function create()
|
||||
resetFastCar();
|
||||
}
|
||||
function update(elapsed:Float) {
|
||||
|
||||
function update(elapsed:Float)
|
||||
{
|
||||
if (!fastCarCanDrive && fastCar.x > 2000) {
|
||||
resetFastCar();
|
||||
fastCarCanDrive = true;
|
||||
}
|
||||
|
||||
var offset = Math.sin(curBeatFloat / 4) * Math.cos(curBeatFloat / 16) * 85;
|
||||
|
||||
// back limo drive
|
||||
if (Options.lowMemoryMode) {
|
||||
bgLimo.frameOffset.x = Math.sin(curBeatFloat / 4) * Math.cos(curBeatFloat / 16) * 85;
|
||||
bgLimo.frameOffset.x = offset;
|
||||
} else {
|
||||
for(e in [bgLimo, dancer1, dancer2, dancer3, dancer4, dancer5]) {
|
||||
e.frameOffset.x = Math.sin(curBeatFloat / 4) * Math.cos(curBeatFloat / 16) * 85;
|
||||
e.frameOffset.x = offset;
|
||||
}
|
||||
}
|
||||
}
|
||||
function beatHit(curBeat:Int) {
|
||||
function beatHit(curBeat:Int)
|
||||
if (FlxG.random.bool(10) && fastCarCanDrive)
|
||||
fastCarDrive();
|
||||
}
|
||||
|
||||
|
||||
function resetFastCar() {
|
||||
function resetFastCar()
|
||||
{
|
||||
fastCar.x = -12600;
|
||||
fastCar.y = FlxG.random.int(140, 250);
|
||||
fastCar.velocity.x = 0;
|
||||
fastCar.moves = false;
|
||||
fastCarCanDrive = true;
|
||||
}
|
||||
function fastCarDrive()
|
||||
{
|
||||
FlxG.sound.play(Paths.soundRandom('carPass', 0, 1), 0.7);
|
||||
|
||||
fastCar.velocity.x = (FlxG.random.int(170, 220) / FlxG.elapsed) * 3;
|
||||
fastCar.velocity.x = FlxG.random.int(170, 220) * 60 * 3;
|
||||
fastCar.moves = true;
|
||||
fastCarCanDrive = false;
|
||||
}
|
||||
@@ -55,10 +55,10 @@ class Setup {
|
||||
case "lib" | "git":
|
||||
final lib:Library = {
|
||||
name: libNode.att.name,
|
||||
type: libNode.name
|
||||
type: libNode.name,
|
||||
skipDeps: libNode.has.skipDeps ? libNode.att.skipDeps == "true" : false,
|
||||
};
|
||||
if (libNode.has.global) lib.global = libNode.att.global;
|
||||
if (libNode.has.skipDeps) lib.skipDeps = libNode.att.skipDeps;
|
||||
switch (lib.type) {
|
||||
case "lib":
|
||||
if (libNode.has.version) lib.version = libNode.att.version;
|
||||
@@ -143,7 +143,7 @@ class Setup {
|
||||
case INSTALL:
|
||||
var lib:Library = event.data;
|
||||
var globalSuffix:Null<String> = lib.global == "true" ? " --global" : "";
|
||||
var skipDeps = lib.skipDeps == "true" ? " --skip-dependencies" : "";
|
||||
var skipDeps = lib.skipDeps ? " --skip-dependencies" : "";
|
||||
var commandPrefix = commandSuffix + globalSuffix + skipDeps;// + " --no-timeout";
|
||||
switch(lib.type) {
|
||||
case "lib":
|
||||
@@ -278,8 +278,8 @@ class Setup {
|
||||
typedef Library = {
|
||||
var name:String;
|
||||
var type:String;
|
||||
var skipDeps:Bool;
|
||||
var ?global:String;
|
||||
var ?skipDeps:String;
|
||||
var ?recursive:String;
|
||||
var ?version:String;
|
||||
var ?ref:String;
|
||||
|
||||
@@ -439,22 +439,22 @@ uniform bool hasTransform;
|
||||
uniform bool hasColorTransform;
|
||||
|
||||
vec4 applyFlixelEffects(vec4 color) {
|
||||
if (!hasTransform) {
|
||||
if(!hasTransform) {
|
||||
return color;
|
||||
}
|
||||
|
||||
if (color.a == 0.0) {
|
||||
if(color.a == 0.0) {
|
||||
return vec4(0.0, 0.0, 0.0, 0.0);
|
||||
}
|
||||
|
||||
if (!hasColorTransform) {
|
||||
if(!hasColorTransform) {
|
||||
return color * openfl_Alphav;
|
||||
}
|
||||
|
||||
color.rgb = color.rgb / color.a;
|
||||
color = clamp(openfl_ColorOffsetv + (color * openfl_ColorMultiplierv), 0.0, 1.0);
|
||||
|
||||
if (color.a > 0.0) {
|
||||
if(color.a > 0.0) {
|
||||
return vec4(color.rgb * color.a * openfl_Alphav, color.a * openfl_Alphav);
|
||||
}
|
||||
return vec4(0.0, 0.0, 0.0, 0.0);
|
||||
@@ -483,9 +483,7 @@ vec4 textureCam(sampler2D bitmap, vec2 pos) {
|
||||
return flixel_texture2D(bitmap, camToOg(pos));
|
||||
}";
|
||||
|
||||
public static final fragBody:String = "vec4 color = flixel_texture2D (bitmap, openfl_TextureCoordv);
|
||||
gl_FragColor = color;
|
||||
";
|
||||
public static final fragBody:String = "gl_FragColor = flixel_texture2D(bitmap, openfl_TextureCoordv);";
|
||||
public static final vertHeader:String = "attribute float openfl_Alpha;
|
||||
attribute vec4 openfl_ColorMultiplier;
|
||||
attribute vec4 openfl_ColorOffset;
|
||||
@@ -499,16 +497,26 @@ varying vec2 openfl_TextureCoordv;
|
||||
|
||||
uniform mat4 openfl_Matrix;
|
||||
uniform bool openfl_HasColorTransform;
|
||||
uniform vec2 openfl_TextureSize;";
|
||||
uniform vec2 openfl_TextureSize;
|
||||
|
||||
attribute float alpha;
|
||||
attribute vec4 colorMultiplier;
|
||||
attribute vec4 colorOffset;
|
||||
uniform bool hasColorTransform;";
|
||||
|
||||
public static final vertBody:String = "openfl_Alphav = openfl_Alpha;
|
||||
openfl_TextureCoordv = openfl_TextureCoord;
|
||||
|
||||
if (openfl_HasColorTransform) {
|
||||
|
||||
if(openfl_HasColorTransform) {
|
||||
openfl_ColorMultiplierv = openfl_ColorMultiplier;
|
||||
openfl_ColorOffsetv = openfl_ColorOffset / 255.0;
|
||||
}
|
||||
|
||||
openfl_Alphav = openfl_Alpha * alpha;
|
||||
|
||||
if(hasColorTransform) {
|
||||
openfl_ColorOffsetv = colorOffset / 255.0;
|
||||
openfl_ColorMultiplierv = colorMultiplier;
|
||||
}
|
||||
|
||||
gl_Position = openfl_Matrix * openfl_Position;";
|
||||
@@ -516,31 +524,14 @@ gl_Position = openfl_Matrix * openfl_Position;";
|
||||
|
||||
public static final defaultVertexSource:String = "#pragma header
|
||||
|
||||
attribute float alpha;
|
||||
attribute vec4 colorMultiplier;
|
||||
attribute vec4 colorOffset;
|
||||
uniform bool hasColorTransform;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
void main(void) {
|
||||
#pragma body
|
||||
|
||||
openfl_Alphav = openfl_Alpha * alpha;
|
||||
|
||||
if (hasColorTransform)
|
||||
{
|
||||
openfl_ColorOffsetv = colorOffset / 255.0;
|
||||
openfl_ColorMultiplierv = colorMultiplier;
|
||||
}
|
||||
}";
|
||||
|
||||
|
||||
// TODO: camera stuff
|
||||
public static final defaultFragmentSource:String = "#pragma header
|
||||
|
||||
void main(void)
|
||||
{
|
||||
gl_FragColor = flixel_texture2D(bitmap, openfl_TextureCoordv);
|
||||
void main(void) {
|
||||
#pragma body
|
||||
}";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user