https://linen.dev logo
Join Discord
Powered by
# flixel
  • d

    dazzling-ocean-80407

    05/27/2023, 5:55 PM
    alright
  • h

    hallowed-ocean-84954

    05/27/2023, 7:02 PM
    What's ShaderEd ? I'll have to look that up. You mean ? That looks cool. I use glsl-canvas in vscode but I was looking for an IDE at one point.
  • h

    hallowed-ocean-84954

    05/27/2023, 7:04 PM
    There are basically two ways to convert shadertoy shaders for use in flixel that I know of - manually - there are some guides about (disclaimer, I wrote one), or using . You could use similar examples to convert from ShaderEd though I suspect you could confiure the IDE to work more like flixel shaders and thus simplify the process - just a guess though from watching the video.
  • d

    dazzling-ocean-80407

    05/27/2023, 7:10 PM
    yeah, it's that
  • d

    dazzling-ocean-80407

    05/27/2023, 7:11 PM
    alright
  • f

    famous-soccer-17653

    05/27/2023, 7:33 PM
    How do i put the last item right next to the first item when the first item is selected, and the first item right next to the last item when the last item is selected? I want to make an illusion that the list scrolls infinitely

    https://cdn.discordapp.com/attachments/165234904815239168/1112101385475993600/image.png▾

  • f

    famous-soccer-17653

    05/27/2023, 7:35 PM
    i forgot i should put the code block
  • f

    famous-soccer-17653

    05/27/2023, 7:35 PM
    Copy code
    hx
            var lerpVal:Float = CoolUtil.boundTo(elapsed * 7.5, 0, 1);
    
            for (i in 0...menuItems.length)
            {
                menuItems.members[i].updateHitbox();
                var middleItem:Float = (FlxG.width / 2) - (menuItems.members[curSelected].width / 2);
                var totalWidth:Array<Float> = [0, 0];
                for (j in i...curSelected)
                    totalWidth[0] += (itemSpace + menuItems.members[j].width);
                for (h in (curSelected + 1)...i)
                    totalWidth[1] += (menuItems.members[h].width + itemSpace);
                if (i < curSelected)
                    menuItems.members[i].x = FlxMath.lerp(menuItems.members[i].x, (middleItem - totalWidth[0]), lerpVal);
                else if (i > curSelected)
                    menuItems.members[i].x = FlxMath.lerp(menuItems.members[i].x, ((middleItem + menuItems.members[curSelected].width + itemSpace) + totalWidth[1]), lerpVal);
                else
                    menuItems.members[i].x = FlxMath.lerp(menuItems.members[i].x, middleItem, lerpVal);
    
            }
  • b

    better-ability-6982

    05/27/2023, 8:01 PM
    Has anybody seen this problem where the bar on an HTML5 game fills up 50% of the way and then just stops? My game was working fine, I added some trace statements and now it freezes here. ...I rolled back those trace statements and it still freezes. It's so weird

    https://cdn.discordapp.com/attachments/165234904815239168/1112108277753446441/image.png▾

  • b

    better-ability-6982

    05/27/2023, 8:13 PM
    Restarting my PC fixed the problem.
  • e

    elegant-glass-62997

    05/27/2023, 8:28 PM
    No smoke fx, no blood so it is clear that the frame drop happens when the enemy spawn. It is very odd, it is only a bg pic and some flxsprites...

    https://cdn.discordapp.com/attachments/165234904815239168/1112115019929366688/dojo15.gif▾

  • e

    elegant-glass-62997

    05/27/2023, 8:31 PM
    I have set the hitbox to 0 width and height. I detect collisions with Pythagoras theorem.
  • m

    most-eve-98431

    05/27/2023, 8:32 PM
    Uhhh
  • m

    most-eve-98431

    05/27/2023, 8:32 PM
    That seems complicated
  • h

    hallowed-ocean-84954

    05/27/2023, 8:36 PM
    I guess I would try prespawn kill and recycle but it's odd unless the images are not being cached which they should be by default. Unless your enemy spawning has a lot of special processing going on
  • a

    able-printer-41379

    05/27/2023, 8:38 PM
    in glsl, what kind of variables (varying, uniform, const) are able to be set & gotten in both haxe and the main function for instance, i have a variable called GL_fragColor (which is gl_FragColor) and i want to do this:
    Copy code
    glsl
    variableType vec4 GL_fragColor;
    void main(void){
      GL_fragColor = gl_FragColor;
    }
    but also be able to get it from haxe
    Copy code
    hx
    ...
    trace(Reflect.field(sprite.shader.data, 'GL_fragColor').value);
  • m

    most-eve-98431

    05/27/2023, 8:40 PM
    How did you make the shadows?
  • e

    elegant-glass-62997

    05/27/2023, 8:47 PM
    Actually is not. Imagine a triangle which the A side is on x axis the B side on y axis and you only have to calculate hypotenuse (aka sprite1 distance from sprite2) :
    var distance:Float = Math.sqrt(A*A + B*B );
  • e

    elegant-glass-62997

    05/27/2023, 8:48 PM
    It is a mirror flxsprite with ColorMatrixFilter
  • m

    most-eve-98431

    05/27/2023, 8:48 PM
    God, I have so much to learn
  • e

    elegant-glass-62997

    05/27/2023, 8:50 PM
    I learned Pythagoras theorem from school. I am Greek, Pythagoras was Greek, so I suppose it is very common knowledge in my country...
  • e

    elegant-glass-62997

    05/27/2023, 8:51 PM
    About the ColorMatrixFilter I didn't know about it, maybe a week to 10 days ago. I just learnt it by googling.
  • m

    most-eve-98431

    05/27/2023, 8:52 PM
    But, how does it work? You just double the sprite or something?
  • e

    elegant-glass-62997

    05/27/2023, 8:54 PM
    I made a class which handles both FlxSprites (character + shadow) at the same time.
  • e

    elegant-glass-62997

    05/27/2023, 8:54 PM
    When the project will be completed, I will opensource it. You will be able to see the source code, if you want.
  • m

    most-eve-98431

    05/27/2023, 8:55 PM
    I'd appreciate it!! The game looks awesome
  • e

    elegant-glass-62997

    05/27/2023, 8:55 PM
    You will be able to modify it and build it yourself, if you want to get your hands dirty
  • m

    most-eve-98431

    05/27/2023, 8:55 PM
    Lol
  • e

    elegant-glass-62997

    05/27/2023, 8:58 PM
    Actually it is not my game, I am just porting it to haxeflixel for learning purposes. It is called "Dojo of Death". A favorite old flash game. You can see a gameplay video here

    https://youtu.be/m-JgVaDakPA▾

  • e

    elegant-glass-62997

    05/27/2023, 9:00 PM
    @most-eve-98431 In case you interested, I have about 9 open source game prototypes written with haxeflixel in my itch.io page : https://harpwood.itch.io/
1...980498059806...9809Latest