Minor's Recent Forum Activity

  • While I would say an array is the easiest way I have thrown this together showing how you could do it with a string of 1's & 0'S.

    HTML5 Demo

    Press "Space" to make coins appear best wait until the last coins have gone off the screen before pressing "space" again.

    [attachment=0:313i1cih][/attachment:313i1cih]

  • Set a variable to AnimationFrameCount-AnimationFrame?

    AnimationFrameCount is the number of frames in the animation. AnimationFrame is the current animation frame.

  • Why not have a blank square in the spritefont and add a "space" in the string in character set box on the left.

    No need to find and replace anything.

    [attachment=0:mpllxl4o][/attachment:mpllxl4o]

    **EDIT

    My spritefont has A-Z then a blank square then 0-9. My character set is ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789

  • You could do it with a tiled background.

    [attachment=0:1tm3mg5f][/attachment:1tm3mg5f]

  • Why not just set the platform X & Y vectors to 0.

    Gravity will take over and your character will just fall to the ground. No need for a variable or timers. Or am I missing something?

  • Wow, that's really neat! I was looking around for something like this recently; my space based shooter would look great with an animated nebula in the background...especially since the working title is 'Nebular Drift'

    Any way to get it moving?

    I have no idea

    If you are mathematically minded/genius you could implement

    Density Wave Theory

    .

    Or you could try to cheat with extra canvases. Create a random number and plot the point/star on a different canvas depending on this number and then rotate the canvases at slightly different speeds. Not sure how it would look but would probably be better than rotating the 1 canvas.

    **EDIT

    Scratch that.

    Link to gif -

    (7mb & recorded at 10fps)

    Multiple canvases destroys the galaxy.

  • So after playing around with this for a few hours I think I've gone as far as I can due to my math & lack of real programming language knowledge.

    Here is the code I think I sort of implemented or not. More likely not.

        public Vector3[] GenerateArm(int numOfStars, int numOfArms, float rotation)
        {
            Vector3[] result = new Vector3[numOfStars];
            Random r = new Random();
    
            float fArmAngle = (float)((360 / numOfArms) % 360);
            float fAngularSpread = 180 / (numOfArms * 2);
    
            for (int i = 0; i < numOfStars; i++)
            {
    
                float fR = (float)r.NextDouble() * 64.0f;
                float fQ = ((float)r.NextDouble() * fAngularSpread) * 1;
                float fK = 1;
    
                float fA = ((float)r.NextDouble() % numOfArms) * fArmAngle;
    
                float fX = fR * (float)Math.Cos((MathHelper.DegreesToRadians(fA + fR * fK + fQ)));
                float fY = fR * (float)Math.Sin((MathHelper.DegreesToRadians(fA + fR * fK + fQ)));
    
                float resultX = (float)(fX * Math.Cos(rotation) - fY * Math.Sin(rotation));
                float resultY = (float)(fY * Math.Cos(rotation) - fX * Math.Sin(rotation));
    
                result[i] = new Vector3(resultX, resultY, 1.0f);
            }
    
            return result;[/code:1i0h2gyi]
    
    I understand some but not all.  I've disabled my implementation of the lines:
    
    float fArmAngle = (float)((360 / numOfArms) % 360);
    float fAngularSpread = 180 / (numOfArms * 2);
    
    When using these lines there isn't a spiral just a nice circle.  Also the code converts degrees to radians so maybe that's where my version trips up.
    
    This is what generates using my sort of hack of the code.  Which doesn't look too bad but when changing some values it either destroys the spiral or makes a nice circle.
    
    [img="https://dl.dropboxusercontent.com/u/1646976/Game%20Media/Misc/galaxy.png"]
    
    [url=https://dl.dropboxusercontent.com/u/1646976/ConstructTutorials/Construct2/Not%20Very%20Good%20Galaxy%20Gen%20V1/index.html]HTML5 Demo[/url]
    
    And the capx.  You'll need the [url=https://www.scirra.com/forum/plugin-canvas_t64239?&hilit=canvas][h2]Canvas Plugin[/h2][/url] to have a play around.
    
    [attachment=0:1i0h2gyi][/attachment:1i0h2gyi]
    I wasn't really planning to use it for anything [i][h2](or am I?)[/h2][/i] other than a learning exercise and I love stuff like this.
    
    If anyone does have a play and improves it just post it here and if possible explain my stupidity in the implementation of code or maths.
  • Finished commenting the capx for maze generation and the solver.

    HTML5 Demo

    Controls:

      R - Generates a new maze Left click - Place start point Right click - Place end point Spacebar - Solve Maze C - Clear solved path so you can find on new one on the same maze

    I've tried my best to explain how the maze is generated but I'm not great at it. I hope the explanation makes some sense or you can at least work it out from the events.

    [attachment=0:1tfelxa9][/attachment:1tfelxa9]

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • wow, fantastic Minor ! i really admire what your doing there and did with your low res dungeon project! did you ever consider writing a post where you explain how the maze is generated and the different wall sprites are set? That would be absolutely fantastic and would drive me to continue my abandonend dungeon project

    fldr

    Thank you. I can write a tutorial on the maze generation if it would be of some use. The tiling is bitwise tiling and I think there are a couple of tutorials on that already but I can also do that too. I'll also comment the capx and post it for anyone to have a play around with.

    Give me a couple of days for the capx and a bit longer for an explanation.

    shinkan

    Minor Indeed. this is really fantastic!

    Thank you sir

  • Minor

    that looks interesting

    Thanks

    Minor

    Jesus, that´s really nice! Can you share how you did that?

    Beaverlicious

    I finally managed using one of my favourite things. Cellular Automata. It loops through the array that stores the maze. Any open cell/floor that has 3 wall neighbours

    (so to the left, right, up, down)

    turns into a wall. This makes it start at dead ends. It continues looping through turning open cell/floor dead ends into walls. I kind of works like a floodfill.

    What you are left with is the path because if a cell/floor is part of the path it has only 2 wall neighbours the other 2 are also open cells in the path.

    Sorry for the terrible explanation. If you are interested I can comment the the capx that includes the maze creator (Prims Algorithm

    sort of

    ) and the solver (Cellular Automata). Just let me know.

  • After many failures in the past for some reason I went back to implementing a maze solving algorithm for my unfinished Lowrez Jam Game.

    Got it working too

  • Here's a fixed version.

    I've changed the box from a tiled background to a sprite. Personally I think using tiled background's as obstacles or items is a bad idea as there are less checks and things you can do on a tiled background than you can do on a sprite.

    The last action checks for a sprite overlapping a sprite and destroys the top one. That way 2 can't stack on top of each other. You can't do this sort of check on a tiled background.

    [attachment=0:11tuxpkr][/attachment:11tuxpkr]

Minor's avatar

Minor

Member since 24 Jul, 2009

None one is following Minor yet!

Connect with Minor

Trophy Case

  • 15-Year Club

Progress

15/44
How to earn trophies