R0J0hound's Forum Posts

  • Take a look at the sdk section of the manual. Specifacally the runtime reference. You can get a layer by name so that helps, but you can't get a type by name. The usual method is to use a object type parameter for an action or something. Then you can get a reference to that object like that.

  • For one object you could save it's x,y,angle, etc every frame to an array, then play it back.

    Something like this:

    You could do the same for multiple objects.

    Another idea would be to save the player inputs and play those back. Unfortunately that is tricky to get a perfect replay with since the varying dt will get the timing off quick. It is possible though with a carefully designed game. It may not even matter in the long run as it would give some variation in the long run.

  • You can look at the manual here:

    https://www.scirra.com/manual/66/projects

    1. You can change the "window size" to change the pixel size, and if you set the "full screen in browser" to "letterbox scale integer" which will keep it scaled by a 2x, 3x, 4x... amount depending on the the actual window size.

    2. As above the "full screen in browser" option will help there.

    3. I think this is the snap to grid option on the view tab:

    https://www.scirra.com/manual/38/ribbon

    4 no idea of the context of this question.

  • An array would work well to have a value for each tile. Just make it's size the same as the tilemap's number of tiles, horizontal and vertical. To find if a certain tile is touched you can use the expressions in the tilemap to convert the touch's x and y to a column and row.

  • Try using the "force own texture" layer setting.

  • The box2d one is per object, whereas the chipmunk one applies to everything. You can replicate per object with a force proportionate to the object's speed and in the opposite direction.

  • Add a sprite to use as a line, and make it's origin centered on the left. Also make it's height 4 or something, that will be the line thickness. Name the sprite "line".

    Then you can use the qarp() expression to do the curve and you could do this:

    global number px=0

    global number py=0

    every tick

    --- line: destroy

    --- set px to start.x

    --- set py to start.y

    repeat 100 times

    --- create line at (qarp(start.x, (start.x+end.x)/2, end.x, (loopindex+1)/100), qarp(start.y, (start.y+end.y)/2+200, end.y, (loopindex+1)/100)

    --- line: set angle toward (px,py)

    --- line: set width to distance(self.x,self.y,px,py)

    --- set px to line.x

    --- set py to line.y

  • I'm on my cell so I can't write a whole lot but:

    1.

    All the old lines are destroyed, and new ones are created every tick.

    2.

    It's done every tick Regaudless.

    Another thought, the variable I had "px" is short for previousX instead of playerX. It better represents what they do. Also the every tick event relates more with event 6 so I had it right above it as I recall.

    In events 4 and 5 the corner that is being added or removed aren't the ones being compared with the distance.

    In event 6 it's looping from the corner that was last added to the one that was first added. I went that way so I could set px before the loop started. So the lines would be created between the locations player,corner,corner...

    I can maybe make up a picture to explain all of it better.

    Edit:

    The motion bit would be best done manually I think. The physics or any of the behaviors aren't really suited for it.

  • Guess I'll cross post this:

    If you have a list of tiles that you don't want to be solid, you can copy the tilemap and remove those tiles when the game runs.

  • Ok, here's an example. Just set toErase to a list of tiles that are decoration.

    The tile numbers are numbered like this:

     0  1  2
     3  4  5
     6  7  8
     9 10 11[/code:rdxv0r8t]
    
    [url=https://dl.dropboxusercontent.com/u/5426011/examples31/partial_solid_tilemap.capx]https://dl.dropboxusercontent.com/u/542 ... lemap.capx[/url]
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah, that's not an error. Hmm, It's puzzling why the window doesn't show.

  • Here's a capx of the idea:

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

    The movement still needs improving.

  • My reasons for writing a plugin/behavior are these:

    1. Adding a feature that events can't do.

    My paster/canvas plugins are an example of that. They add the ability to draw to a texture which isn't possible otherwise. I think another one was a spritesheet plugin.

    2. Interfacing with some existing JavaScript library or code.

    This kind of blends with one sometimes. Examples include the chipmunk behavior and the peerjs plugin.

    3. Speed improvements.

    The only example I had for this is my isometric behavior. I had it working with just events, but since it had multiple nested loops it wasn't very fast. Actually I think the sorting algorithm was O(n^3) worst case. There is some overhead with the event system so converting to js allowed me to sort 3x as many objects and still not affect the framerate.

    Other than that I'd avoid doing it for something specific to one project. Others do it, but for me it's more tedious.

    I'd recommend playing around with the sdk yourself though, it's fairly easy. I'm not sure it would be simpler to make your idea with a plugin than events though.

  • You could try finding the remainder of every number from 2 to one less than the number with a loop. If the remainder is ever 0 then it's a composite.

    Global number num=8175

    Global number isComposite=0

    Repeat num-3 times

    Compare num%(loopindex+2) =0

    --- stop loop

    --- set isComposite to 1

  • I think gumball's idea should work. It's just using a sprite to make a line, but that part can be dealt with later.

    The first task would be to get the motion working in tight spaces like that, and not get snagged at intersections. I think a pacman tutorial would probably help with this, since the motion is similar. Aka. Motion in tight corridors.

    To keep the object from crossing it's own path is the next problem. Basically you could have a square at each intersection and make them solid as needed.

    To do this you can use an array as a list of corners. The list starts with just the starting corner in it.

    When the distance between the player and the last corner in the list gets big enough, then the last corner the player overlapped is added to the list. The idea here is if the distance is bigger than the distance between corners then the player passed a corner.

    To do the backtracking, the distance between the player and the 2nd from last corner of the list is compared, and if it's less than a edge length, remove the last corner from the list.

    So now that gives you a list of corners. If you keep all of them but the last one solid, then you can keep the player from crossing it's path.

    Finally you can take that list and make lines between them all and from the last to the player. You could either use gumball's idea or the canvas plugin I suppose.

    Anyways that's the idea at least, I was going to try to type out events but it seemed more understandable describing it. I haven't tested the idea yet but it should at least be a start.