mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-04-21 19:31:52 -04:00
touch in progres
This commit is contained in:
parent
d4e955ce79
commit
d25b81e1dc
3 changed files with 73 additions and 4 deletions
source
|
@ -5,6 +5,7 @@ import flixel.FlxSprite;
|
|||
import flixel.FlxState;
|
||||
import flixel.addons.display.FlxGridOverlay;
|
||||
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||
import flixel.input.touch.FlxTouch;
|
||||
import flixel.math.FlxMath;
|
||||
import flixel.text.FlxText;
|
||||
import flixel.tweens.FlxTween;
|
||||
|
@ -98,6 +99,7 @@ class FreeplayState extends MusicBeatState
|
|||
// LOAD CHARACTERS
|
||||
|
||||
bg = new FlxSprite().loadGraphic(Paths.image('menuDesat'));
|
||||
bg.setGraphicSize(Std.int(FlxG.width / FlxG.camera.initialZoom));
|
||||
add(bg);
|
||||
|
||||
grpSongs = new FlxTypedGroup<Alphabet>();
|
||||
|
@ -190,8 +192,62 @@ class FreeplayState extends MusicBeatState
|
|||
}
|
||||
}
|
||||
|
||||
var touchY:Float = 0;
|
||||
var dyTouch:Float = 0;
|
||||
var velTouch:Float = 0;
|
||||
|
||||
var veloctiyLoopShit:Float = 0;
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
if (FlxG.onMobile)
|
||||
{
|
||||
if (FlxG.touches.getFirst() != null)
|
||||
{
|
||||
var touch:FlxTouch = FlxG.touches.getFirst();
|
||||
|
||||
velTouch = Math.abs((touch.screenY - dyTouch)) / 50;
|
||||
|
||||
dyTouch = touch.screenY - touchY;
|
||||
|
||||
if (touch.justPressed)
|
||||
{
|
||||
touchY = touch.screenY;
|
||||
dyTouch = 0;
|
||||
velTouch = 0;
|
||||
}
|
||||
|
||||
if (Math.abs(dyTouch) >= 100)
|
||||
{
|
||||
touchY = touch.screenY;
|
||||
|
||||
if (dyTouch != 0)
|
||||
dyTouch < 0 ? changeSelection(1) : changeSelection(-1);
|
||||
// changeSelection(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (velTouch >= 0)
|
||||
{
|
||||
trace(velTouch);
|
||||
velTouch -= FlxG.elapsed;
|
||||
|
||||
veloctiyLoopShit += velTouch;
|
||||
|
||||
trace("VEL LOOP: " + veloctiyLoopShit);
|
||||
|
||||
if (veloctiyLoopShit >= 30)
|
||||
{
|
||||
veloctiyLoopShit = 0;
|
||||
changeSelection(1);
|
||||
}
|
||||
|
||||
// trace(velTouch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
super.update(elapsed);
|
||||
|
||||
if (FlxG.sound.music != null)
|
||||
|
@ -218,7 +274,7 @@ class FreeplayState extends MusicBeatState
|
|||
{
|
||||
if (touch.justPressed)
|
||||
{
|
||||
accepted = true;
|
||||
// accepted = true;
|
||||
}
|
||||
}
|
||||
#end
|
||||
|
@ -311,7 +367,7 @@ class FreeplayState extends MusicBeatState
|
|||
// lerpScore = 0;
|
||||
|
||||
#if PRELOAD_ALL
|
||||
FlxG.sound.playMusic(Paths.inst(songs[curSelected].songName), 0);
|
||||
// FlxG.sound.playMusic(Paths.inst(songs[curSelected].songName), 0);
|
||||
#end
|
||||
|
||||
var bullShit:Int = 0;
|
||||
|
|
|
@ -270,7 +270,7 @@ class TitleState extends MusicBeatState
|
|||
|
||||
outlineShaderShit = new TitleOutline();
|
||||
// logoBl.shader = swagShader.shader;
|
||||
logoBl.shader = outlineShaderShit;
|
||||
// logoBl.shader = outlineShaderShit;
|
||||
// logoBl.shader = alphaShader.shader;
|
||||
|
||||
// trace();
|
||||
|
@ -284,7 +284,7 @@ class TitleState extends MusicBeatState
|
|||
gfDance.antialiasing = true;
|
||||
add(gfDance);
|
||||
|
||||
gfDance.shader = swagShader.shader;
|
||||
// gfDance.shader = swagShader.shader;
|
||||
|
||||
// gfDance.shader = new TitleOutline();
|
||||
|
||||
|
@ -392,6 +392,15 @@ class TitleState extends MusicBeatState
|
|||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
/* if (FlxG.onMobile)
|
||||
{
|
||||
if (gfDance != null)
|
||||
{
|
||||
gfDance.x = (FlxG.width / 2) + (FlxG.accelerometer.x * (FlxG.width / 2));
|
||||
// gfDance.y = (FlxG.height / 2) + (FlxG.accelerometer.y * (FlxG.height / 2));
|
||||
}
|
||||
}
|
||||
*/
|
||||
if (FlxG.keys.justPressed.I)
|
||||
{
|
||||
FlxTween.tween(outlineShaderShit, {funnyX: 50, funnyY: 50}, 0.6, {ease: FlxEase.quartOut});
|
||||
|
@ -614,6 +623,8 @@ class TitleState extends MusicBeatState
|
|||
|
||||
function addMoreText(text:String)
|
||||
{
|
||||
lime.ui.Haptic.vibrate(100, 100);
|
||||
|
||||
var coolText:Alphabet = new Alphabet(0, 0, text, true, false);
|
||||
coolText.screenCenter(X);
|
||||
coolText.y += (textGroup.length * 60) + 200;
|
||||
|
|
|
@ -88,6 +88,8 @@ class FlxSymbol extends FlxSprite
|
|||
|
||||
var newFrameNum:Int = daFrame;
|
||||
|
||||
// need to account for movie clip / Graphic bullshit?
|
||||
|
||||
switch (daLoopType)
|
||||
{
|
||||
case LOOP:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue