perezbalen's Recent Forum Activity

  • Hi

    When a bullet hits a player, I want to know which instance of the enemy shot it (so I can increase it�s experince, or something). How can I do that?

    Thanks

  • Hi

    I`m trying to have a bullet be destroyed if it hits any solid object. If it hits a wall, the celling, the floor, the player, etc; since I have lots of sprites that build the stage.

    So far, the Overlaping events need to choose a particular object to do something, and I don�t want to do the same thing for n different objects.

    Is there a way to have the bullet trigger an action when it hits anything solid?

    thanks.

  • Thanks. But when you say:

    Actually, in general I would recommend you do not make actions which call other actions directly; they should both just call a common function.

    how should I write the common function?

    <font face="Courier New, Courier, mono">instanceProto.constructorFunction = function (param1,param2)</font>

    or

    <font face="Courier New, Courier, mono">function constructorFunction (param1,param2)</font>

    or something different (I?m having a lot of trouble figuring this thins out)

  • Hi

    I have problems understanding what javascript is doing.

    I have this code:

    <font face="Courier New, Courier, mono">

    Acts.prototype.MakeDungeon = function (text_value, mapSizeX, mapSizeY)

         {       

              this.testFunction(2,2); //This works

                  Acts.prototype.MakeCustomDungeon (text_value, mapSizeX, mapSizeY, 5, 15, 150, 50);

         };

         

         Acts.prototype.MakeCustomDungeon = function (text_value, mapSizeX, mapSizeY, roomMinSize, roomMaxSize, roomMaxArea, roomsMaxNum )

         {       

              this.testFunction(2,2); //This DOESN?T works

         };

         

         instanceProto.testFunction = function (x,y)

            {

                     //do stuff

            }</font>

    I have two Acts that can be called from the editor. One has more options than the other, so when I call <font face="Courier New, Courier, mono">MakeDungeon</font>, it itself calls <font face="Courier New, Courier, mono">MakeCustomDungeon</font> and gives default values to the missing information.

    The thing is that when I call <font face="Courier New, Courier, mono">this.testFunction</font>, it works only from the <font face="Courier New, Courier, mono">MakeDungeon</font>, and not the <font face="Courier New, Courier, mono">MakeCustomDungeon</font>.

    When the <font face="Courier New, Courier, mono">this.testFunction</font> is called from <font face="Courier New, Courier, mono">MakeCustomDungeon</font> (via <font face="Courier New, Courier, mono">MakeDungeon</font>), I get an error message:

    <font face="Courier New, Courier, mono">Javascript error! TypeError: this.testFunction is not a function</font>

    Can someone help me figure out what?s going on?

  • Apparently, I had to declare the function like this:

    instanceProto.testFunction = function (x,y)

         {

              //do stuff

         };

  • Hi

    I�m exploring the plugins SDK, and have hit a roadblock.

    I managed to get my plugin running. I�ve managed to create new Actions; like this one:

    <font face="Courier New, Courier, mono">

    Acts.prototype.DoSomething = function (text_value, X, Y)

         {

              var i,j;

              for (i=1; i < X; i++)

              {

                   for (j=1; j < Y; j++)

                   {

                       testFunction(i,j);

                   }

              }

         };

    </font>     

    But I can�t figure out how to do functons. In this example, testfucntion (i,j).

    I made it like this:

    <font face="Courier New, Courier, mono">

         this.testFunction = function (x,y)

         {

              //do stuff

         };

    </font>

    But it doesn�t work. How can I white a function,or aprivate method, or some code that the Acts.prototype.DoSomething can use?

    Thanks.

  • Hi

    Is there a way to use conditions in for loops, like:

    <font face="Courier New, Courier, mono">for (int ytemp = y; ytemp > (y-ylen); ytemp--)</font>

    Or at least a way to have the loop count backwards, like from 10 to 1 (instead of form 1 to 10) ?

  • THanks for the replies.

    I'm building art on the fly for random generated lavels, and I read that the tiled object was less expensive than the sprites, so that's why I asked.

    I was wondering if COnstruct has a feature that lets you pre-render images before they are used in the game (so I don�t need to place one sprite on top of the other)

  • Hi

    The original half life used a tecnique to make rocks texture appear less tiley. They had 8 (or something) very similar looking -yet different- tiles, that all conected to each other. And when applying this to a rock wall, the engine would randomly choose a tile every "square" instead of using the same tile every time.

    so far, I`ve been able to replicate this effect in Construct 2 using sprites, but was wondering if there is a way to do this using Tiled backgrounds.

    Thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks. That did the trick.

  • Hi

    I�m having this problem: When my player runs, it�s catching the bullet he just fired, and being hit by it.

    Is there a way to know which object spawned another object, so I can set my bullet to ignore the collision with the object who spawned it?

    Thanks.

  • Hi I have the following event:

    Enemy On collision with Enemy.

    and the action should do something, like have the first Enemy turn right, and the second turn left (in this example, when enemies collide, they change direction).

    My question is, how do I reference the first enemy and/or the second, in the action "code"?

perezbalen's avatar

perezbalen

Member since 6 Feb, 2013

None one is following perezbalen yet!

Connect with perezbalen

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies