Yann's Forum Posts

  • thehen

    Super weird

    To be sure open runtime.js and check if there is a line with

    var MIN_SIZE = 1;[/code:3hc77qfi]
    
    If it's the case, you should have the last version (same as mine).
    
    I'm reposting the link here just in case 
    [url=https://app.box.com/s/hqn9vrttsuoesx2oolgk]polygon.zip[/url]
    
    If you have the same version, and if you still have the same bug hmmmmmmm
    ... trying on firefox.....
    hmmm working...
    
    Well at least double check, and if you still have the problem, I'll investigate since it would mean it's a plugin bug (:
  • bon4ire

    Nope you can do the same in C2.

    You can do

    + condition A
        -> Action 1
    + else
    + condition B
        -> Action 2
    + else
    + condition C
        -> Action 3
    + else
    + condition D
        -> Action 4
  • Excal

    Four of the globals are semantic constant use every where. (well the EMPTY and WALL are just used for the Maze Generation part so you could put them in local constant in this group if you really want)

    There shouldn't be any issue with them, and I found out that they were more helpfull in global scope than in local. If you were to define the same constant at other places you wouldn't be sure of if they have the same value or not. I think local constant can lead to confusion.

    Now the 3 other constant (WIDTH,HEIGHT and DENSITY) are parameters for the whole algorithm. Soooo I think they have their place on global scope as well.

    As far as the runtime variable, generating is a kind of global state of the algorithm so well.. makes sense to be global, and for the three last, if I could initialize them with an expression as it's possible in C they would also be constant.

    So yeah as much as I would agree with you that too much globals is bad because of global namespace cluttering and overall incertainty (which doesn't exist with constant). I think these ones are justified.

    Now as far as the vector list is concerned, you could actually put the function on start of layout.

    The vector list is just a look-up table of the four possible directions you can travel in the maze.

    It looks like:

    Array.At(0,0) =  1
    Array.At(0,1) =  0
    Array.At(1,0) =  0
    Array.At(1,1) =  1
    Array.At(2,0) = -1
    Array.At(2,1) =  0
    Array.At(3,0) =  0
    Array.At(3,1) = -1

    This way can just represent a direction by a number (the X index of the array)

    For instance going West is the #2 direction.

    It's the same as goint X + Array.At(2,0), Y + Array.At(2,1)

    If you look at the dig function, you have a local variable named choice with the four direction represented in a string. I should one of this number at random and then remove it, and run the dig function on this direction recursively.

    Since the variable is local the list is rebuilt automagically for each new cell you travel.

    So for a clear and simple answer, no, you don't need to create other vector list, it's not something that gets modified (which you could create constant array :D)

    Also, placing the createVectorList call in start of layout would make more sense (:

    Hope I was clear.

    Edit: you can redownload my capx, I implemented multiple steps (another constant to control how many)

  • Excal

    Maybe you can run the maze algo more than once to create 2 or 3 different path before generating the entire map the way I did it.

  • thehen

    Oh yeah sorry, that's a bug happening when the polygon got no size, ctx.drawImage() doesn't like it.

    I corrected the bug, but forgot to update :D

    Should be updated in less than an hour (:

    Edit:

    hop! updated

    not sure if I solved it the right way (I force the width and height to be at a minimum of 1)

  • shinkan

    Hey sorry to hear that, I can download them from twitch, and they don't seem too heavy so maybe I can throw them on a ftp somewhere...

    I'll let you know if I find some solution (:

  • newt

    Thanks somehow the texture got renamed into hpBar.png.rename ... weird... maybe it's a bug but I wouldn't know how to reproduce it.

  • interesting problem

    here's my solution

    randomPath.capx

    The algo in a nutshell:

    maze algorithm -> deduce a path -> remove the maze and create something more random while preserving the path

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You didn't really search, did you? (:

    heartHUD.capx

    simpleHPBar.capx

    reallySimpleHPBar.capx

    I think it's still a bit too early for multiplayer, and it might be a difficult feature to use.

    To me modularity is the one part that falls behind in C2. I already talked about it, but making an RPG in C2 while having the possibility to make broad changes is still not easy.

    For instance I'd like to use C2 layout to create all the location you have in an RPG, but being able to make broad modfications on all my layouts like Modifying layers disposition/properties/content mostly.

    Things you can't really handle at runtime.

    So yeah, I think modularity will go toward this idea.

    Also modularity because a good game is seldom made alone. Being able to work with more than one developper would be a must.

    And it would probably increase the quality and size of games.

  • Darn they don't have the same signature as the others... It might break the cleanliness of my capx /o/

    I'll try someday, ring me again in a few days if I didn't pop a new capx.

  • thehen

    Indeed I missed this post

    Here's a possible solution:

    polyTrail.capx

    The idea is to insert new segment by adding a vertex at the begining and end of the list

    To fade the trail you just have to remove the pair of vertices in the middle.

  • ebrar

    That's indeed an interesting idea. To avoid crashing the browser you should either generate them in another language (raw javascript, python, C, etc) and create a JSON file with the list of path that can be loaded in an Array (you should save one to see how it looks)

    or distribute the calculation on many ticks. It would still take a while to calculate, but at least chrome wouldn't hang and still find a way to save the result (you have an action to download the JSON file from an array)

  • Omegalpha

    As you can see I'm not the author of this topic, I've never really programmed shaders.

    Quazi is way out of my leagues he does some crazy stuff. If I am a good technician, this guy is a bloody magician :D

  • for this kind of calculation you're better off with GPU acceleration

    http://www.scirra.com/forum/falling-sand-on-gpu-through-pixel-shader_topic63143.html