R0J0hound's Recent Forum Activity

  • Hmm well the meat of it is to compare what was typed so far with the command.

    text = left(command, len(left))

    If that's true that could be shown as a guess.

    I don't want to deal with form objects or js so here's a way to do it with the keyboard and text object.

    dropbox.com/scl/fi/13ai14e9r80zmv1qdm2j2/rough_autocomplete.capx

    Probably can do it with a textbox too. Just replace the text objects with textboxes. Then do some CSS to make the main editbox have a transparent background so you can see the guess underneath.

    Probably could do better with parsing the commands for syntax errors and giving more advanced autocomplete per token.

  • Spine, Spriter and dragonbones? No editor in C2 (that's not really possible) but you can load stuff in that was created with those tools.

  • Plugin development is anarchy. I don't think there is any set opinion how it should be done. Even vanilla features don't adhere to a set standard. Things were just added and improved over time. So in the end you can just do things however you like I say.

  • Apart from using it with the ?: operator, I’ve used = for stuff like this:

    Say you want to convert a small list of color names to a color values you could do:

    rgba(100*(color="red"), 100*(color="green"), 100*(color="blue"), 100)

    Or if you happened to want to handle different colors or more of them:

    chooseIndex((color="red")*1+ (color="green")*2+ (color="blue")*3, rgba(0,0,0,100), rgba(100,0,0,100), rgba(0,100,0,100),rgba(0,0,100,100))

    Granted there are better ways if you wanted to handle lots of color names but this is handy and simpler for a few.

  • Var n=4

    On sprite clicked

    Repeat n times

    — create line at sprite.x, sprite.y

    — line: set width to 0

    — line: set angle to 360/n+45

    Every tick

    — line: set width to min(100, self.width+200*dt)

    Line: width=100

    Trigger once

    For each line

    — create sprite2 at line.x,line.y

    — sprite2: move 100 pixels at angle line.angle

    — create sprite3 at sprite2.x, sprite2.y

    — sprite3: set frame to loopindex

  • Well you can do it with a bunch of conditions. For two vars

    If A>B

    If B<A

    If A=B

    For three you just do the same for all cases

    a>b and a>c

    B>a and b>c

    C>a and c>b

    A=b and a>c

    A=c and a>b

    B=c and b>a

    A=b and b=c

    For four it would be similar.

    Another way would be an array.

    3 a

    22 b

    4 c

    Then you could sort the array to get the greatest, but you’d need some logic to when there are multiple with the same value.

    A third idea that I like best is to use sprites instead. Make a sprite called item, give it two variables: name and value. Then just create an instance for each fruit and set the vars.

    Finally to get the highest and get a random one when there is a tie you’d do:

    For each item ordered by item.value+random(0.5) descending

    — set best to item.name

    — stop loop

  • Presumedly yes. I don’t know what would be amiss otherwise.

  • As long as the json you load is the same format as the json you saved from the dictionary it should work. You can’t just load a general json into a dictionary.

  • If your animated sprite has the platform behavior the size and collision shape can be changing per frame which can lead to overlaps. Just hazarding a guess, construct’s collision resolution logic may not work well with pushing a concave shape out of something?

    To make motion more stable you’d typically have the player be an invisible rectangle with the platform behavior, and the animations would be a different sprite positioned on top of it.

    So you’d only want to do your own collision response if the performance was good, not if it worked better? Anyways you’d have to make it and see how it performs. Most custom collision response I’ve done seems fast enough.

    Isn’t p5.js just a different engine? From what I’ve found different engines don’t play well together. But I guess you’ll see how true that is if you try it.

  • One idea is a Text instance per letter and store the original character in instance an variable. Then it's just picking after that.

    Another idea is utilizing left, mid and right to modify a text variable. For example text = left("********", n) & right("Codeword", 8-n) to change the first n characters to stars. Or to change the nth character to a star: text = left(text, n)&"*"&right(text, len(text)-n-1) But there's more to it than that probably.

  • One idea is to make a sprite of a ring and spawn that where the player is. Then you have the rings increase in size and fade in opacity. You could play around with how you draw the ring. Maybe have feathered edges, and maybe shade it. You can also play around with using the additive blend on the rings. There may even be a shader to distort the texture underneath.

    To limit this effect on water tiles you'll need to mask it somehow. Put the rings on a layer with force only texture and a tilemap on top with the destination-out blend. There may be cleaner ways to mask it with sub-layers or other blend modes.

    You could also do it as a simulation. Basically each point of water has a spring to make it return to a normal level and there are also springs connecting the 4 adjacent point of water. This could be done with an array. Then to draw it you could draw it with drawingcanvas if you want to simulate per pixel, or maybe utilize a distort mesh for a simpler sim. You could it with a color gradient based on depth. For mesh that would mean you'd use a gradient texture and mess with the uvs to have a color per vertex. Alternately you could color it like a normal map. The latter could be more useful when used with effects but you'll have to look into what's available for distortion effects. There are other ideas to explore here.

    Limiting all that to just the water still requires making. Or just make the ground drawn higher.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Probably when moving fast the objects move too far so it incorrectly guesses which way to resolve the collision.

    Here's a slightly different way to do it that supports rotated boxes and wedges. It treats the player as a ball. The collisions are resolved in the closest direction so when on a slope you'd slide down.

    dropbox.com/scl/fi/06pnm5xx1c1z92h9u09vl/3d_box_and_wedge_collsion_response.c3p

    You can break this too. With a radius of 16 you can go up to 1000 pixels per second and still work at 60fps. 1000/60 = 16. Higher speeds can pass though walls. To fix you can use larger radius', slower speeds, or move in multiple smaller steps per frame so you can check multiple times.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 155 followers

Connect with R0J0hound