R0J0hound's Recent Forum Activity

  • I can't reproduce that. Tween always stops at an exact value in my tests.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I mean doing:

    Every tick

    — set layer 0 scroll to scrollx+16, scrolly

    Seems to do the trick. But it still is subject to bounded scrolling along the edges of the layout unless you select unbounded scrolling on the layout properties.

  • Probably the set layer scroll action.

  • Maybe try a different algorithm to generate the maze? Or you’ll have to explain how the algorithm you’re using should work. Maybe your logic is flawed, or maybe you made a typo somewhere.

  • I should clarify that I don’t make or sell templates. I can appreciate the desire to take on a coder to implement the game mechanics but I’m not your guy since I’m not available for such a time commitment.

    With my limited time I like answering posts with ideas or concepts on how to do things. But rarely am I able to provide complete solutions that don’t have to be adapted to your project.

    Anyways. There’s already a few examples to try here in this topic. Dops example can be made in c2 no problem. It’s not using any new c3 features. Isn’t it possible to just recreate a c2 project in the same way as the c3 one?

  • I’d rather help convey ideas and suggestions that you can implement instead of making the game for you or taking your money.

    What specifically are you having trouble with? I’m sure showing what you have and listing what’s not working can allow more people to maybe help.

    If there’s ever something you can’t figure out how to do, there also is some simpler variation you can do to build your skills.

    For example: have you tried your hand at doing all that logic with just squares instead of with an isometric grid? That would be one approach to work out the logic easier and you’d just make it isometric afterwards.

    Or you could forget all the math and do it a different way.

    1. Add a sprite for an isometric square and call it “square”. Draw it as an isometric square and put the image origin at the bottom corner.

    2. Place a bunch of them down in the editor to make your iso grid just like the image of a grid you posted. To assist, you can turn on the editor’s grid and make the grid width to half the square’s width, and the height to half the square’s height.

    3. Add another sprite for the isometric objects you want to move around. For example a “cube.” Draw an isometric cube and set the origin at the bottom corner. You can customize the collision polygon so it matches the image better if you like. Place one or more of those on the layout on top of the squares.

    4. Next let’s get it ready for events. Add the drag drop behavior to the cube, and add an instance variable number to the square sprite and call it “occupied.”

    5. Ok now events. The logic we are going for is to lock the cube objects to the nearest squares when not dragging. And we set the square’s occupied variable to true when there’s a cube on it so we can tell if a square is free or not.

    Then events would look like:

    Start of layout
    — square: set occupied to 0
    
    Start of layout
    For each cube
    Square: occupied=0
    Square: pick closest to cube
    — cube: set position to square
    — square: set occupied to 1
    
    Cube: on drag start
    Square: pick closest to cube
    — square: set occupied to 0
    
    Cube: on drop
    Square: occupied=0
    Square: pick closest to cube
    — cube: set position to square
    — square: set occupied to 1
    
    For each cube ordered by cube.y ascending
    — cube: move to front

    And viola! Basically no math to snap objects to empty spaces on an isometric grid. And ripe to be heavily tweaked to any more complex behavior you like.

  • Snapping can be done by converting the xy positions to isometric, snapping that and converting it back to xy.

    Xy to iso:

    ix=y+x/2

    iy=y-x/2

    ISO to xy:

    X=ix-iy

    Y=(ix+iy)/2

    You can modify those slightly to align the grid from somewhere different than (0,0) to say (cx,cy):

    Xy to iso:

    ix=y-cy+(x-cx)/2

    iy=y-cy-(x-cx)/2

    ISO to xy:

    X=ix-iy+cx

    Y=(ix+iy)/2+cy

    And finally the snapping formula:

    Int(X/grid)*grid

    Combined snapping to an isometric grid would look like this:

    set x to sprite.x-corner.x
    Set y to sprite.y-corner.y
    Set ix to int((y+x/2)/grid)*grid
    Set iy to int((y-x/2)/grid)*grid
    Set x to ix-iy+corner.x
    Set y to (ix+iy)/2+corner.y

    After snapping you only need to check grid positions to see if an object is there. Whether that be picking objects at an xy or the closest to an xy that’s a small distance away. You could also check if an object is overlapping a point if you setup the collision polygon to only overlap the base of the object. You could also use an array to store the object’s snapped isometric coordinates *grid. But you’d need to select a corner so that those values aren’t negative.

    The simplest is probably just setting the object’s collision polygon to just cover the base, then put all your isometric objects in a family. Then you’d know if a space was occupied with a condition like:

    System: family overlaps point x,y

  • Should be simple as:

    compare Anglediff(Angle(player.x,player.y,enemy.x,enemy.y)-player.angle, 0)<90
    — shoot from right cannon
    Else
    — shoot from left

    Or some variation of that.

  • It’s a dom element, so you can use any css you want to style it, including rotate it.

    w3schools.com/Cssref/css_pr_rotate.php

    Dom elements have a set css action you can use to do that.

  • Looking cool!

    If you end up delving into layouting, aka automatically positioning and resizing elements, I recently found this video that makes it sound fairly straightforward:

    youtube.com/watch

    Also currently your plugin builds and modifies you gui, which is basically a retained mode gui. Another approach is an immediate mode gui that builds the gui on the fly per frame, which has some interesting pros and cons.

    As for the programmer art colors, I do that too, but I've recently been toying with the idea of using a palette generator to get some pleasing colors to go together. I've also seen sites that provide nice palettes specifically for uis. Anyways, just some ideas that could give some inspiration.

  • I generally just derive the formula from scratch if it’s not working. But looks like you extracted the left of the decimal, added your own decimal then did some math on the left that resulted in another decimal.

    Maybe it’s a misunderstanding on what zeropad does.

    Zeropad(1, 3) = “001”

    Zeropad(12,3) = “011”

    Zeropad(123,3) = “123”

    As to the last method. I probably should have used another variable name besides k. Anyways, you just need to change var and it should spit out for example:

    12 -> 12

    1234 -> 1.234k

    123456 -> 123.456k

    12345678 -> 12.345m

    1234567890 -> 1.234b

  • You probably meant something like:

    int(var/10^12)&”.”&zeropad(int(var/10^9)%1000, 3)&”T”

    But you could also do the same thing with:

    int(Var/10^9)/1000&”T”

    You could also do it like this to handle thousands,millions,billions,trillions,etc all at once:

    K= min(4, int(log10(var)/3))

    int(var/10^(3*k-3))/1000&tokenat(“,k,m,b,t”, k,”,”)

    If you have more suffixes you’d add them to the token at portion. I just used 4 suffixes, hence the 4 in the min().