Domino3057's Forum Posts

  • I was originally using the sine function, but I want to have more control over the NPC. Essentially I'll be setting up horizontal lines or rows across my map and have enemies spawn on different rows. Each row will have a different movement pattern. So I started, exploring the 8 direction with simulate movements. Unfortunately, this behavior isn't working as I expected. I attached the CAPx. Right now I want the 8 direction to move left until it collides with an object and then reverse. Simple enough right? But for whatever reason, it hits the object, bounces a bit the continues left. Anyone know which rookie mistake I have used on this one? Maybe there are other methods of doing this? Thanks!

  • For anyone interested or for future reference, I think I have found a solution.

    I needed to be able to do this:

    Touch and release > Spawn ONLY one object

    Touch and hold > Spawn several objects until touch is released

    -------------------------------------------------------------------------------------------------

    I solved it with a global variable. Here is the simplified version:

    Create Global variable: "Shoot"

    If "Shoot" = 0, "on any touch start" Spawn object

    System Wait 0.2 seconds set "Shoot" = 1

    If "Shoot" = 1, Is in touch Spawn object

    On any End touch, Set "Shoot" = 0

  • The iPad has a feature where if you "touch" anything such as text, it treats it as a single click. However, if you hold your "touch" it offers a new option to copy. I want to utilize this feature in a different way.

    Touch and release > Spawn ONLY one object

    Touch and hold > Spawn several objects until touch is released.

    Anyone now how to use this? Thanks!

  • codah I didn't even consider decimals were being called as well. Thanks for clearing that up.

    Both of these options work great. At least for this part in my code the "choose" expression actually runs smoother. Thanks so much for the multiple options to solve my issue.

    This is a great community, very helpful!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Wow, looks like that worked. Not sure why that would be required, guess I'll dig through the docs later. Thanks for the quick help though, Really appreciate it!

  • I have an instanced object with a variable called "salvo" that I want to change at random up to the number 3 (possibly even more in the future) every time a new object is spawned. I set up this test to see if the variable is changing but it stays constant when I use the "random(3)". Strangely enough if I hard code it to say >set salvo to 1 on the next object spawned it will work. Is there a reason my "random" code won't work for this? Am I missing something? Thanks in advance for the help! File is attached:

  • Ah I see, Thanks! I didn't even think about splitting the formula over 2 lines. I was trying to write the entire expression in one line of commands. I really appreciate it. This will help me solve another issue I have as well.

  • Most of the expressions I have completed so far have been trial and error or lucky guesses based on my limited knowledge. I can't seem to figure this one out though. I have attached a CAPx of this problem to the post.

    I have an object (Hero) that is pinned to another object (Anchor). Currently Hero unpins and moves to the right of the anchor 50 pixels whenever you click/touch the screen. Super simple.

    Is in Touch > Hero> Set position (Anchor.X +50 , Anchor.Y + 0)

    I only want the hero to move 50 pixels in X. But I'd like it to move in a negative or positive 50 pixels based on where the mouse clicks. Mouse clicks anywhere to the left of the anchor, Hero goes left 50 pixels. Click anywhere to the right, Hero moves right 50 pixels. Obviously, my current setup only allows a +50 in X, regardless of mouse position. I have tried a lot of different setups, but have failed miserably.

    Can any of you more experienced people help me figure this out? I'm sure it's really easy, but my expression skills are lacking! Thanks!!

  • Attached is my current project file. The movement of the ball works like a catapult. You pull back and then let go and the ball launches. I want the user to be able to continuously do this action to traverse around the zone. So I set up an anchor point that follows the ball via distance joint. When the user touches the screen the anchor is frozen and the ball is pulled back off the anchor point to relaunch at any time. So far, it works fairly well. My problem is, it only works using the "in touch function" I only want this action to occur when you touch the ball. When I change the "Is in Touch" to "Is Touching Object" my entire setup breaks. I think I just have my mechanics disordered or something. I am a novice at all of this and what I have so far is hacked together. Maybe someone can help me decipher where I went wrong. Thanks!

  • Ok, after further investigation it looks like for now, the solution is to toggle the physics of that object to "Immovable" when it comes into contact with a defined surface. It seems redundant that I would have to define EVERY surface to set Physics to immovable. Maybe I can create a list of objects that force the physics to freeze and not have to write it out for each object. I guess I'll figure that out as I go.

  • Hello,

    I am trying to launch and object the have it stick to a wall. Similar to the sticky bombs from the demoman in TF2. Currently, I can launch a ball and then it bounces off of walls, but I can't seem to find tutorials on having it stick to the target. Does this type of action have a name? Maybe I'm not wording it correctly in my searches. Thanks to anyone who can lend some support.

  • Thanks! I can use this concept for sure! The only issue i have with your example is that the fish won't move unless the mouse is near them rather than just them speeding up when the mouse is near. But, this is really helpful, thanks again.

  • I am not a programmer nor a game designer by any means, so I guess i'll be asking some dumb questions, but here we go: I am creating a simple fish tank game, where clicking on different fish causes different actions to occur.

    Question 1:

    I created a global number to toggle a bullet behavior on and off, however I guess because it is global it affects all the fish I create. How do I have the toggle only occur on the specific fish I click?

    Question 2:

    I have a "cursor over" action, that forces the fish to speed up when you mouse over them, how do I set it up that once the cursor is no longer near them they slow down? I would think there would be a "Cursor off" action, but I can't seem to find one.

    Question 3:

    Is there a cursor proximity action? Meaning the closer the cursor is to the object the more it affects it?

    Thanks!

    https://dl.dropbox.com/u/23591936/Fish3.capx