Rasmus's Forum Posts

  • 12 posts
  • I have attempted to add a new expression function to the Array "plugin", but having a hard time making Construct understand that the expression is taking one parameter.

    I've added the following code to runtime.js:

         Exps.prototype.rank = function (ret, playerNumber)

         {

              var ranking = 1;

                //Do whatever...

              ret.set_int(ranking);

         }

    And added the following to edittime.js:

    AddExpression(13, ef_return_number, "Get rank for player", "Array", "rank", "Get rank for a player");

    The expression shows up in Construct as expected (i.e. I can enter SomeArray. and the "rank" expression will show up in the dropdown menu). Though, if i enter SomeArray.rank(1), it says 'rank' does not take 1 parameter (should have 0).

    What am I doing wrong? How do I properly make the expression take a parameter?

  • I've installed the socket-io (crossbrowser) plugin for C2, and I wanted to test this with node.js and the example server/client provided by Zack0.

    I have downloaded and installed node.js for windows (running W7), and installed the socket.io module as described by Zack0 in the original post:

    <img src="http://s15.postimage.org/kk0bw9pwb/Socket_IOpack.png" border="0" />

    As it appears, the module seems to be successfully installed.

    Though, when I try to run the example server, I get this error message:

    <img src="http://s19.postimage.org/usaxpxb9v/run_example_server.png" border="0" />

    • but again, I thought I had installed the socket.io module...

    I'm not the most advanced user in this kinda thing, so I thought I am probably doing some simple thing wrong - perhaps one of you guys could spot it? <img src="smileys/smiley9.gif" border="0" align="middle" />

  • I'll probably be using a different animation later on. Something viewed from above, so it won't matter.

    Still curious tho ;) Thinking of the flip/unflip action?

  • Hehe, yea, I thought there would be a more simple method for something like this. Your example seems to work fine for what I want to create <img src="smileys/smiley1.gif" border="0" align="middle" />

    I'll move on with something like that, thanks a lot for your help! <img src="smileys/smiley20.gif" border="0" align="middle" />

  • Did you do anything to make their movement look more smooth? Other than just adding a lot of pointers?

    Thanks for your response!

  • Sure, here's an example <img src="smileys/smiley1.gif" border="0" align="middle">

    EnemyMovement.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi all

    At the moment I am messing around with a tower defense-like game. I have an 'Enemy' sprite which should follow a specific path through the layout.

    The solution I came up with this far is creating some invisible 'Pointer' sprites and on collision (between Enemy and Pointer) setting the angle of the Enemy equal to that of the Pointer. This allows the enemy to guide through the layout (using the Bullet behavior). However, this does not result in a smooth movement at all, and doesn't look good when the game is played.

    Does anyone have an idea how I can make the Enemy sprite follow a specific path through the layout in a "smooth" movement?

    Thanks!

  • That does seem to work - gives me the effect i want :) Thanks for the idea!

  • I'm using the sine wave behaviour to move an object (a small airplane) back and forth. I want to mirror/unmirror the object at each end of the wave, so it's not "moving backwards" half the time.

    Is there any way to do this, or somehow obtain a similar effect?

    Thanks!

    Ras

  • Cool - works perfectly :) Thanks a lot!

  • I'm not sure if this is the "best" way to do it, but I used the following:

    System - Every tick ---> ObjectA SetPosition(ObjectB.X, ObjectB.Y)

    Hope that makes sense... Basically this will keep setting the position of ObjectA to that of ObjectB. You can add some pixels to the X or Y axis if you like.

  • Hi everybody

    I've just started using Construct 2, and my first project is a platform game. I have a window size of 640/480 and a layout of greater size. In the top left corner of the layout I have positioned some text objects containing information such as ammo, points, etc. I want to position these text objects relative to the window (not the layout) - but I'm having trouble figuring out how to do this.

    Does anybody have a nice tip on how to do this?

    Thanks!

    Ras

  • 12 posts