R0J0hound's Recent Forum Activity

  • DrewMelton

    I compared your capx to the original cap and found the issue.

    In events 7-10 you need to change the "miner.CurX" expressions to "miner.At(0)" or "miner.At(1)" like in the CC cap and it works.

  • I can't open the capx at the moment but you'll have to tweak your array events slightly.

    Construct classic arrays are 1 based so to access the first element you'd use

    Array(1)

    Array(2) for the second and so on.

    C2 uses 0 based arrays, so the expressions to access the first two elements would be:

    Array.at(0) and array.at(1)

    So I think if you subtract one from the array indexes throughout your capx it should fix it.

  • DrewMelton

    I'd go for using separate animation frames rather than separate objects.

    Here's a bitwise example here that uses the tilemap instead of array, but the concept is about the same.

    tilemap-auto-tile-help_p721581?#p721581

    I had a bit of a go at making an example in isometric. Art is time consuming for me and I wasn't able to find a free tileset that has all 16 combinations required for the bitwise method. I was able to use a modified approach with what I could find though.

    http://opengameart.org/content/cave-tileset

    https://dl.dropboxusercontent.com/u/542 ... tile3.capx

    I also found a useful general reference on isometric here that may be helpful:

    http://gamedevelopment.tutsplus.com/tut ... medev-6511

  • round(var*10)/10 should work for rounding to the nearest tenth.

  • For the first question it's pretty simple, just add a condition to check for when the score is 5 then add an action to set the bullet speed to 500.

    For adding 100 to the speed every 5 seconds you could make an every tick event with an action to set the speed with the expression:

    int(score/5)*100+initial_speed

    Where initial_speed is whatever the bullet speed started at, or rather what speed you want it to start at.

  • I haven't used that plugins so I can't be of help there. I do have a capx where I did chess movement without any third party plugins. It perfectly generates all legal moves for any piece selected, minus moves like en passe and castling. So in short it's a different way to do it but likely not an easy or better.

    https://dl.dropboxusercontent.com/u/542 ... chess.capx

    But I'm sure rex has a way for it to work with his plugin.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Forget about isometric for a moment and look at doing it only in 2d. Isometric can be added later easily enough with the only headache being perhaps sorting.

    The simplest kind of procedural generation is done on a 2d grid. This can be represented by a 2d array which will provide a value for each grid position. Next you as the designer need to choose what the values mean.

    For a continent type you could use say 0 for water and 1 for land. For a dungeon you could use 0 for floor and 1 for walls. It just all depends on what you want to generate. Also there is no reason why you couldn't use 2,3... and so forth for more terrain types, again it depends on what you want to do.

    Note at this point we just have a data representation of the map. If we want to get a visual of it we need to loop over the array and create objects at those positions.

    For example if each tile is 32x32 pixels and the tile's origin is in the center then you can create the map with an event like so:

    Array: for each xy element
    --- Array: current value = 0
    ------> System create water on layer 0 at (Array.CurX*32+16, Array.CurY*32+16)
    --- Array: current value = 1
    ------> System create ground on layer 0 at (Array.CurX*32+16, Array.CurY*32+16)[/code:y0phpsp3]
    
    Or if your sprites are isometric then you can do this.  Note: a 32x32x32 isometric cube will have a 64x64 pixel image.
    [code:y0phpsp3]Array: for each xy element
    --- Array: current value = 0
    ------> System create water on layer 0 at ((Array.CurX-Array.CurY)*32+320, (Array.CurX+Array.CurY)/2*32+16)
    --- Array: current value = 1
    ------> System create ground on layer 0 at ((Array.CurX-Array.CurY)*32+320, (Array.CurX+Array.CurY)/2*32+16)[/code:y0phpsp3]
    
    Well, then on to more about the generation.  The most simple generation other than setting all the array to one value is to set each value to be randomly 0 or 1.
    [code:y0phpsp3]Start of layout
    Array for each xy element
    ---> Array: set value at (Array.CurX, Array.CurY) to choose(0,1)[/code:y0phpsp3]
    
    Beyond that there are a lot of different ways you can generate the maps.
    
    Instead of set setting individual grids you can set horizontal or vertical lines and filled rectangles by using "for loops".  
    
    For terrain you can use the "noise" addon which will give nice perlin noise instead of staic noise.  I've also used a smaller separate array and interpolated it onto the larger array for a more globular noise. 
    
    For the wall bit do a search for "bitwise" for a method to choose a image based on what's around it.  It also can be used for the water shoreline.
    
    To have a land mass that doesn't have any inaccessible areas there are basically two ways to go about it.  One is to pick a spot with land and do a "flood fill" there to mark anything connected and then check for values of land that isn't marked.  A second method is to only grow from existing land so you always know it's connected.
    
    Another topic to look up is "cellular automata" which can be useful at times.
    
    cheers
  • You do not have permission to view this post

  • You'd have to reset sum to zero before every calculation. As a more complete example you could put it in a function so you could calculate xp() from anywhere with for example function.call("xp", 20).

    global number sum=0

    On function "xp"

    ---- set sum to 0

    -------- for "n" from 1 to Function.param(0)-1

    ------------ add 75*2^(loopindex/7) to sum

    -------- every tick

    ------------- function: set return to sum

  • WindowWidth and WindowHeight give the pixel size of the view. With "fullscreen in browser" set to "off" the values will be identical to the viewport size.

  • Savvy001

    The tilemap plugin won't draw anything that's offsceen, which is why only a window area is drawn. One idea could be to set the window/viewport size to be the same as the layout temporarily before pasting.

  • You'll have to do it with a loop. Something like this:

    global number sum=0

    for "n" from 1 to L-1

    --- add 75*2^(loopindex/7) to sum

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound