R0J0hound's Recent Forum Activity

  • For the view, you just need to change the 3D camera angle. But if I pick this up again at a later date it can be made to have a different sloped ground and direction of gravity to make change the view of the dice.

    To have two dice? Hmm... right now it’s not very modular. One way would be to clone all the object types and make the cloned instance have the same values in the instance variables. Then duplicating all the events and using the replace object feature to make the duplicated events use the cloned objects.

    Even then the two dice won’t interact with each other without further collision code.

    In general I just need to revisit this eventually and make it more modular.

  • Nice to know C3 added that expression to the keyboard.

    Looking at my example again it can be simplified a bit by replacing:

    int(tokenat(widths, Function.Call("find",c),","))

    with:

    SpriteFont.CharacterWidth(c)

    I completely missed that. Will update the example shortly.

    Edit:

    example updated.

  • I skimmed that blog article. It certainly in an in depth list, but most of what we are doing here is just enough to do what we want. We aren't intending to make a comprehensive editbox.

    dop2000

    I like that example. Very console like. I noticed you have the same issue as I got where you can't type a "?". Anyways, the solution I came up with was to add an event listener in js that calls a construct function with "e.key" which is what key was typed taking into account shift and capslock. At least in C2 the keyboard object wasn't enough to get that.

    document.addEventListener('keydown', (e)=>{c2_callFunction('keyDown',[e.key]);});

    Here are some tests. The first hides the textbox by setting the css opacity to 0, and draws the text with the text object.

    dropbox.com/s/5xygyt0uo5zyz96/hidden_input_form.capx

    Here's another test that uses spritefonts with variable widths. It supports single line text and lets you type with any character in the spritefont. Clicking sets the cursor position and you can remove charters with delete and backspace.

    dropbox.com/s/4vww2hr0an2cdws/spritefont_input.capx

    Taking the idea further to support highlighting, ctrl moving between words, copy/paste, double click selecting words, and multi lines just require a bit more work but seems possible.

    Issues i encountered were the needing to get the keyboard input with js as mentioned above, and find() was case-insensitive, so I had to make a case sensitive one with a function.

    Here's how the spritefont was generated:

    construct.net/en/forum/game-development/tools-and-resources-27/spritefont-generator-168408

  • I agree with dop, there are pros and cons to making your own text input vs just using the editbox.

    To me, editboxes work well but you are limited how it can look, even with css. Making your own can go from fairly simple like dop’s example to trying to reproduce everything. Clipboard access is the tricky part in js.

    Another idea is to hide the editbox by setting the style opacity to 0. That would let you interact with the editbox but let you draw it as you wish. It’s just fiddly to make them match.

    As long as it works it should be fine. I’ve seem lots of games and software that don’t just use a normal os editbox and it’s seldom an annoyance.

  • The “trigger once” is throwing it off. Basically they all need to not be frame 1 before the event can run again.

    I’d do the logic under a “on frame changed” condition.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The tilemap has some expressions you can use to get that. Namely the row and column of the tile at a certain xy. Then you can use another expression to get the xy of the tile at a certain column and row. That will give you the tiles center then you can get the sides by adding/subtracting half the tile width/height.

    But you can calculate all that directly. For example if the tilemap is at 0,0 with a 32x32 tile size, and the player objects are smaller than 32x32, then this will give you the bounding boxes of each of the tiles the player could be overlapping.

    Gridx= int(player.x/32)

    Gridy=int(player.y/32)

    For i=-1 to 1

    For j=-1 to 1

    Tile at (gridx+i,gridy+j) != -1

    — left = (gridx+i)*32-32

    — right=(gridx+i)*32

    — top=(gridy+j)*32-32

    — bottom=(gridy+j)*32

    — resolve collision

  • An alternative if no one has the add-on is you can manually remove all references to it from the capx.

    Capx files are just zip files and you can access the .c2proj and .xml files for the layouts and events to remove it from them.

  • Wouldn’t setting the layout scale, as you would to zoom in with normal 2d games work?

  • Here's an idea how to make the bullets meander a bit before reaching their target.

    Basically this gradually increases the turning force, and uses sin() to meander in a curvy way. All the numbers in event 4 can be tweaked to change the effect in various ways.

    dropbox.com/s/ffnik6zpbie7vte/chaos_bullet3.capx

  • If it keeps sliding you have friction set to 0. That’s what your screenshot shows anyways. Set it to a value between 0 to 1 so it will slow down.

  • The order of the actions matter. Set the angle first, then move forward.