keepee's Recent Forum Activity

  • Nerdsville

    with scaling/fullscreen modes mouse.x doesn't always match correctly

    but if you do mouse.x("layername") it will return the mouses position on that specific layer

    you can also do mouse.x(0) where 0 is the layer ID

  • of course it can

    well, i hope this works.. like i said i don't have a gamepad to test it with

    https://dl.dropboxusercontent.com/u/533 ... dAim2.capx

    we can use the angle() expression, which returns the angle between two points like this: angle(x1,y1,x2,y2)

    in this case we can just do angle(0,0,gamepad.axis(0,2),gamepad.axis(0,3))

    this will basically return the current angle of the right stick, after that it's just a matter of positioning it a certain distance away from the player at this angle.

    the disabled action in the .capx is an alternative way of doing this

  • you'll need to use the expression gamepad.axis(pad index, axis index)

    it returns a number between -100 and 100 depending on how a pads stick is positioned.

    'indexes' are zero based, which means gamepad 0 is the first, gamepad 1 is the second etc,

    the axis indexes go like this:

    left X = 0

    left Y = 1

    right X = 2

    right Y =3

    so gamepad.axis(0,2) will refer to the first gamepads right X axis

    it will return -100 if the stick is fully to the left, 0 if in middle, 100 if fully right

    I don't have a gamepad to test this with, but try this:

    https://dl.dropboxusercontent.com/u/533 ... adAim.capx

    if it works as intended the right analog stick should position the crosshair somewhere within a 200*200 square around the player

  • one other thing, instead of replacing a carriable physics object with a non-physics version of the same object, you can just disable and enable the physics behaviour when it is picked up and thrown

  • combining physics and other movement behaviours at the same time will almost always cause messiness because the two behaviours will be clashing as to where to position the object each tick

    two options

    you could delete platform behaviour and attempt to recreate the same movement with the physics actions.. this is difficult to fine tune and would require collision detection for being able to jump off the ground etc

    or, you could delete the physics behaviour from the platformer, and instead have an invisible physics object the same size that follows the player, purely for colliding with other physics objects. This is good if you want to keep the traditional platformer style movement, the downside is that the player doesn't move when getting hit by other objects.. although that might be preferred.

    I had to try method 2 if it worked okay:

    [r164] https://dl.dropboxusercontent.com/u/533 ... mphys.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • same errors as on start up

  • I'd just use the sprite

    if you happen to be using linear sampling (in project properties), you can make it a 1x1 sprite and stretch it to the size of the screen.

  • AnD4D

    unless you're doing it 100,000 times a tick, it will make no difference.

    It's just for simpler readability

  • Yes, but you should use the 'canvas' plugin (search the forum), it lets you draw shapes with curved lines and stuff.

    It would not be a good idea to attempt to do this with sprites.

  • Katala AnD4D

    you can lose the sprite coordinates and just have:

    angle(0,0,Sprite.Physics.VelocityX,Sprite.Physics.VelocityY)

  • apologies, as this is no doubt a noob question

    A while ago I made one tiny change in the box2dweb runtime.js to suit my needs, but the problem is I can not find the equivalent line in runtime-asm.js

    it is line 1093 in runtime.js

              return restitution1 > restitution2 ? restitution1 : restitution2;

    I'm guessing the search can't find this in runtime-asm.js because the names have been abbreviated maybe

    any tips of how to find this? or is it not there and I'm misunderstanding something

keepee's avatar

keepee

Member since 6 Jan, 2012

None one is following keepee yet!

Trophy Case

  • 12-Year Club
  • Email Verified

Progress

13/44
How to earn trophies