Cybearg's Recent Forum Activity

  • blackhornet

    Perfect, thank you! So apparently Construct 2 "remembers" a certain instance once it has been created for a while and any new commands will affect the most recent instance?

  • I had the exact same problem yesterday and I sadly didn't get a response from this forum. I sent an email to the CocooonJS guys, but I haven't gotten a response yet. If I get a response, I'll post what they say.

    It's very frustrating, but I'm glad it's not just me.

  • You don't need to do the overlapping bit. You know which SpawnPt you are creating your object at, so just set your custIndex right after each create.

    How would I do that? That's kind of the question I've got: how do I make modifications to a newly-spawned instance of an object?

  • I'm working on a Tapper clone. Currently, I have patrons that spawn at the start of the game and start moving to the right. The player moves up and down based on an array for the location. The bar counters likewise use an array to denote the start and end of the counters, so the mugs know when to fall.

    I want to set an index for each spawned customer based on... something. At first, I was going to determine their appropriate index by checking them against the y values of the player's movement array, but that didn't seem to work. Now instead, I'm trying to set each customer's array based on them colliding with a SpawnPt object (an invisible object that they are spawned from), but it doesn't seem to work. So far as I can tell, they all act as though their custIndex = 0 (based on the location they are destroyed at when moving to the left), even though it should be set differently for each. Any idea of what is wrong?

    For reference, c100 is a customer type under the Customers family. custIndex is an instance variable set for the Customers family.

    <img src="http://i41.tinypic.com/f4jm8x.png" border="0" />

  • To be clear, I have the Personal license, not the free version.

    I have a couple somewhat unrelated questions, but all deal with me trying to test Construct 2 on native mobile through CocoonJS.

    First off, I understand that, to quickly and easily test Construct 2 games with CocoonJS, you need the CocoonJS Launcher app, which I got. When you open the app, you get an option for Demos or Your App. Since I'm testing, I want the latter. I'm then taken to a screen with a register button and a text field for a registration code.

    Now, the problem is that I DID register online at the page that the Register button takes me to. However, I DID NOT receive any registration code by email. I got an email to confirm my registration and then another email thanking me for having registered, but I never got any "registration code." Where do I find it?

    Secondly, I DID manage to compile the project using the CocoonJS cloud (though it was very slow) so I could test it on my mobile device. However, I immediately noticed that the game (an early prototype that only has controls implemented) doesn't seem to work for flicking motions.

    To clarify, I implemented flicking by having the game compare the X and Y coordinates of the touch location when touch begins versus when touch ends. I allowed touch to be simulated by the mouse in Construct 2 and it works fine there; I can click or flick properly when testing in HTML5 or Flash on Windows, as well as when I compile a .exe For some reason, though, those flicking gestures don't translate correctly to mobile. Tapping still works, though. Any ideas why?

    Here is the flick code, for reference:

    <img src="http://i39.tinypic.com/10gms5s.png" border="0" />

    The game checks flickX and flickY to see if there has been a gesture. If it detects a recently-ended touch and flickX and flickY are both 0, then it was just a tap. If Y was > 0 but X was 0, then it was a downward flick, etc.

  • blackhornet

    LI0NHART

    Bump so that this question doesn't get lost. What method would you two (or anyone else who reads this) recommend for what I'm trying to do?

  • Thanks! So what time is it recommended that songs are loaded, particularly if there are multiple songs, including ones that don't come until later in the game?

  • I've noticed that when I start a music loop, it takes about a second for the music to begin playing (when it should begin immediately, like it does in the raw sound file). During that second, all other sounds (short sound effects that worked prior to the longer track starting) don't make any sound, as if they're muted.

    Any idea what's up and how to fix it?

  • If I had the option of programming this in C or something like it, it would be fairly simple:

    int barkeepX[4] = { 240, 246, 252, 258 };

    int barkeepY[4] = { 30, 80, 160, 220 };

    int barTop[4] = { 34, 84, 164, 224 };

    int barStart[4] = { 30, 36, 42, 48 };

    int barEnd[4] = { 236, 242, 248, 254 };

    int barkeepIndex = 0;

    if (pressup == true && barkeepIndex > 0)

    {

         barkeepIndex--;

    }

    if (pressdown == true && barkeepIndex < 3)

    {

         barkeepIndex++;

    }

    if (pressdown == true || pressup == true)

    {

         barkeep.x = barkeepX[barkeepIndex];

         barkeep.y = barkeepY[barkeepIndex];

    }

    if (spacebar == true)

    {

         mugSpawn(barkeepIndex);

    }

    void mugSpawn(int index)

    {

         mug.y = barTop[index];

         mug.x = barStart[index];

         while (mug.x < barEnd[index])

         {

            mug.x++;

         }

    }

    ...etc. The logic seems simple and sound. I just don't know how to implement it with Construct 2. Boy, do I wish that it supported direct scripting for this sort of thing. I really, really, really hope that becomes a feature, or else I can't imagine sticking with Construct for very long once things get complicated.

    Still, I want to give it a chance and learn (and I've already paid for the Personal license!), so what method would the veterans recommend?

  • I went ahead and set the layout to destroy the prototype when the game begins. Thanks for that suggestion!

    As for the positioning, I really have no specific plan because I don't know what options are at my disposal. Each bar will be a series of sprites on multiple layers (a background sprite, a foreground sprite, and a "cover" sprite in the cases where I need to make it seem like the patron sprites are coming out of a door), each with a different layout. There will be changes in where the player should be positioned in the X and Y at the end of each bar and each bar should have a specified "beginning" and "end" X and a certain Y coordinate. This will be used to spawn the patrons (which will move along the bar from its X start toward its X end), handle spilling drinks (which will spill if they reach the X start without touching a thirsty patron), and handling refills (which will drop off the bar if they reach the X end without the player in the appropriate bar index to catch them).

    Basically, I'm trying to emulate the real Tapper game as closely as possible, so just imagine what would be needed to get the player to snap to the right movement positions and to indicate where the mugs and patrons should see as the ends of the bar. There will additionally be multiple levels, as in the original Tapper game.

    youtube.com/watch

  • I'm currently trying to learn Construct 2 by making a Tapper clone. I'm currently at the place where I have a bar tender who makes a filling/throwing motion, which spawns a mug object that travels down the bar until it topples when reaching a certain X position.

    Now, I need the bar tender to move up and down the bar, "snapping" to the correct X and Y coordinates when he makes a move. Likewise, the mug object needs to know which bar counter it is on and look in some kind of data set to find out what the maximum X position is before spilling. Any suggestions on how I can do this most efficiently (and any documentation to give me a good start)?

    Also, on a somewhat unrelated note, how can I have an object "prototype" that has all the properties and code set, but doesn't need to be pre-set in the world? The mug object I previously mentioned makes a falling sound as soon as the game begins because it is flying around off-screen and "falling" after it goes past the minimum X location. Obviously, I don't want the prototype to do that. How can I prevent it?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Looks neat, but I see a potentially major problem. I'd recommend you watch this video about designing controls for a touch screen:

    penny-arcade.com/patv/episode/designing-for-a-touch-screen

Cybearg's avatar

Cybearg

Member since 17 Sep, 2013

None one is following Cybearg yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies