R0J0hound's Recent Forum Activity

  • Here's one for the physics behavior:

    But you can do it without with simply:

    global number gravity=1000

    global number speed=200

    global number step=0.1

    global number vx=0

    global number vy=0

    global number x=0

    global number y=0

    every tick

    --- dot: destroy

    --- set x to cannon.x

    --- set y to cannon.y

    --- set vx to speed*cos(cannon.angle)

    --- set vy to speed*sin(cannon.angle)

    repeat 100 times

    --- add gravity*step to vy

    --- add vx*step to x

    --- add vy*step to y

    --- create dot at (x,y)

  • It looks like it stops working, or at least jumps, when it goes to just one touch. Maybe setting the oldtouch value when a touch is released would alleviate that. I think I addressed that in my original capx, but I haven't looked.

  • If you're not checking for performance with the sprite then disabling the collisions won't matter.

    Yeah, only the image size affects the amount of vram used. The size of the sprite doesn't matter. Also, there is no performance difference.

  • I wasn't aware there was a way to disable collisions. An "on collision" is basically a "is overlapping" with a trigger once. Collisions are only detected with a object if it either has the solid behavior or you use one of those events.

    The image size doesn't affect the performance. It just reduces the amount of vram used which can be important for mobile devices.

  • In 1 and 4 "this" is the current instance.

    In 2 "this" in the onCreate function is the current instance. It's set to a global variable so the instance can be referenced in that widow callback.

    In 3 self is used so the callback "errorFunc" can access the instance. Otherwise I think this would be the global window object.

    The following link probably is better help:

    http://javascriptissexy.com/understand- ... master-it/

  • From what I can tell the body is moved around directly and everything else: eyes, arms and legs point toward some target positions. I don't really see any physics other than the jump.

    This tutorial is relevant for the arms and legs I suppose. It's for construct classic but it explains it well, and all of it could be done in C2.

  • Physics engines usually do no conserve energy, there is loss over time. The reason is everything is an approximation. You can however keep the energy close to being constant by correcting the velocity.

    So the equation is this:

    E=KE+PE

    E=0.5*m*v^2 + m*g*h

    solved for v

    v = sqrt((E-mgh)*2/m)

    So the events to correct the velocity so energy is conserved would be:

    global number total_energy=0

    global number initial_y=0

    global number speed=0

    global number angleOfMotion=0

    Start of layout

    --- set initial_y to ball.y

    --- set total_energy to ball.physics.mass*10*(480-ball.y)

    ball: y<initial_y

    --- ball: set y to initial_y

    every tick

    --- set speed to sqrt((total_energy-ball.physics.mass*10*(480-ball.y))*2/ball.physics.mass)

    --- set angleOfMotion to angle(0,0,ball.physics.velocityX,ball.physics.velocityY)

    --- ball: physics: set velocity to ( speed*cos(angleOfMotion), speed*sin(angleOfMotion) )

  • Those text adventure creation tools likely implement a lot of the things you'd need for you, so that indeed would be the easiest. Apart from that you can make a text adventure in pretty much any programming language/tool under the sun as long as it lets you use text.

    As far as creating a text adventure the steps are:

    1. creating a way to parse or understand what the player inputted.

    2. using variables and such to define the current game state.

    3. just use a bunch of conditions to do stuff like: if the player types A, and the game state is in B then do C

    For 1 that capx is one possible solution. You can go as complicated as you like here.

    With two you can do absolutely anything. One idea that appeals to me here is to use sprites and stuff to lay everything out. You can then make them all invisible when you run the game. An inventory can be done with a dictionary I'd imagine.

    Three is just a lot of busy work as you should consider all cases.

    The process would be similar with any other tool/language unless they have something specific to text adventures that could make things simpler.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Kat Editor

    I don't know why it happens, it seems to be off and on again issue when saving, although I've never had an issue myself. The best you can do is make periodic backups of your project so if it does get corrupted you won't be at a complete loss.

  • No, those are just expressions used in C2. You don't use JavaScript unless you are making plugins.

  • If your lists are large it makes no difference. You can set the text variables in the same way, but it may not look the cleanest with the event view. Another way is to have the lists in a text file included in the files folder of your project, and loading it with the Ajax object.

    The only complicated looking thing is the tokenat and tokencount expressions but the manual explains them.