noisetank's Recent Forum Activity

  • I'm currently trying to work out the basics of a twin stick shooter (Geometry Wars, for example) in Construct, but it feels clunky and unwieldy.

    Ideally, the way this would work is that pushing a direction on the controller's analog stick would change the angle of movement (or shoot) in the exact direction that the player is pushing toward. I've managed to set up the left stick to correspond to an 8-direction movement behavior, which is bearable, but using the same methods for shooting on the right stick is not. I've managed to rig it up with a second object pinned to the player object (position only) and set the angle with the same code I used to create player movement, but it feels terribly inaccurate when I'm trying to shoot at anything with only 8 directional aim. It's also frustrating trying to figure out just how far I need to nudge the stick to get it to "lock" to the right direction.

    My question is: How can I smooth out these controls? Rather than have 8-direction movements mapped to the sticks, is it possible to convert the X,Y axis into reporting a 360 degree angle? I've been searching for Construct-specific help on the topic, but came up empty. I did, however find this Corona tutorial (http://coronalabs.com/blog/2013/09/24/t ... -and-axis/) that seems like it would have put me on the right track...but trying to replicate it in Construct ended up being an hour wasted.

    Can anyone point me in the right direction on this? It seems like there's a way I could use some clever math to convert the axis into a 360 degree angle that would solve all my problems, but I'm neither clever nor good enough at math to understand how.

  • Update: Okay, figured out the problem, but the solution still escapes me.

    I don't want canons to spawn too close to each other, so I create a "noSpawnZone" around them at the same time the initial touch creates a new canon. However, by adding the condition "Touch is NOT touching a noSpawnZone" to the "On any touch start event", it restricts any new canons from being made while an existing canon is being touched (because there's a "noSpawnZone" being touched SOMEWHERE).

    So, is there a way to "pick" the touch being referenced on the "Any touch start", so it would only check if the touch that triggered the event is touching a "noSpawnZone" rather than checking if ANY touch is?

  • Hello,

    I'm working on a touchscreen game for multiple players. The idea is that a player can tap the screen anywhere once to create a canon, then drag the canon around to control it. If another player wants to join, they can tap anywhere as well to create another canon (as long as they're not within a certain radius of any other canons to avoid accidental spawns by one person).

    I've got the basics of this implemented, however, I've noticed that I can't seem to be able to spawn any new canons while any existing canons are being touched. So, if one player is dragging a canon around, the other player's touch will do nothing until the first player lets go of their canon. Also, if two players touch the screen at nearly the same time, only one will spawn a canon. It's worth noting that, once spawned, all canons can be moved at the same time, so it's definitely picking up all the touches (just not when spawning objects is involved.)

    Can someone explain what I could possibly be doing wrong here? I've done all sorts of tinkering with the code and nothing seems to remedy this problem. My capx is attached.

  • Did this help you noisetank? I'm going to be moving enemy collisions and projectiles into families, and this is going to be huge for me, but will take time. I'll need to make it so if a family projectile hits an enemy in the enemy family, react/animate appropriately

    It's worked to an extent...I can make my player character animate and move independent of the enemy, however I've noticed that the enemy seems to somehow grab the "orientation" variable I set up (sprite is mirrored or not mirrored depending on left or right orientation) and will turn in the same direction as my character does. Weird.

  • That would be a picking problem. :)

    What you'll need to do is pick the "Character_Sprite" that is related to the "Character". Few of the approaches you could take:

    - Saving UID of the "Character_Sprite" to instance variable of "Character" and using "Pick by UID" action.

    - Picking the "Character_Sprite" nearest to "Character". Might be risky approach, depending on how your game works.

    Just what I was looking for, thanks. :D

  • The issue is that it's not the character object itself that's animating, it's the character sprite object that goes along with it. As suggested in all the tutorials I've read, the character object that does all the platforming movements is invisible with a set hitbox. The animations for this character object are in a separate object.

    So my objects are as follows:

    player

    player_sprite

    enemy

    enemy_sprite

    My families:

    Characters

    • player
    • enemy

    Characters_Sprites

    • player_sprite
    • enemy_sprite

    And my events would set up something like this (this doesn't work and I understand why, I just don't know how to fix it):

    Every tick > Set position of player_sprite to player

    Every tick > Set position of enemy_sprite to enemy

    If "Characters" is Jumping > Set "Characters_Sprite" animation to "Jump"

  • So, I'm still fairly new to Construct and even more new to the paid version, so I'm having a bit of difficulty figuring out how to properly implement the Families feature.

    First, some background:

    The main character of my game has an invisible sprite with platformer behavior and a visible sprite with all the animations (walking, running, jumping, shooting, etc) set to the player's position every tick. To trigger these animations, I use the player object's platformer events to change the player_sprite object's animation (ex. If player is on ground and player is moving, set player_sprite animation to run).

    NPCs (be they enemies or friendlies) will generally follow the same set of rules. They may not have quite the same range as the player, but they'll still have the basics (walk, run, jump, shoot, etc) that will trigger much in the same way (if object does platformer event, then visible sptrite does animation).

    What I'd like to do:

    Setting up individual events for every character would be a pain. So instead, I'd like to use families to simplify things and make it SUPER easy to add new characters on the fly. I've been careful to use the same naming conventions across character animations ("Walk", "Run", etc) so there's no issue there, but the think I'm REALLY struggling with is how to select which animation sprite belongs to the picked object sprite.

    As I said, the object that actually MOVES is SEPARATE from the object that the player sees animating. They have no actual connection to each other as far as the game is concerned, aside from the "set sprite to object every tick" event (which still doesn't mean anything to Construct).

    What can I do to make it so this works?

    To summarize the intended functionality with an example event:

    If Character family is jumping, set picked object's animation sprite (which I have put in an Animation family) to "Jump". Making this event will currently just make EVERY character sprite play the "Jump" animation, rather than find just the one that belongs to the acting character.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oh, okay. I think I'm starting to understand the usefulness of functions now. Passing Left/Right/etc to a Move function really cleans things up.

    As for referencing all players...Families are only available in the paid version, correct? I might have to invest. I think that's exactly what I'm looking for.

  • Alright, I took a swing at functions...I'm not sure if I'm following your example correctly, but I don't know if this is going to save me all that much as far as copying events goes. Here's an example of what I've done so far:

    i47.photobucket.com/albums/f173/kitsune37/functions_zpsb74e5e22.png

    Is there a nicer way to clean this up? Otherwise it doesn't seem much more efficient than what I was doing already.

  • aceofpack

    Four controllers on one computer.

    justifun

    Alright, I think Functions were exactly what I was looking for. I'm still not 100% sure how to use them properly, though. Here's a (hopefully) clearer version of what I have set up:

    I have four blank player sprites (named Player0, Player1, Player2, Player3) placed on a layer by themselves. Each one has a "Controller" variable to match their number (0-3).

    When a stage starts, it spawns as many of these player sprites as needed (Player0 for one player, Player0 and Player1 for two players, etc) and pins the selected character animation sprite to each (this might be another issue entirely, but I'm also not sure how to handle two players choosing the same character sprite).

    Now, I have events created for controls and animations, all referencing Player0. What I'd like to do, as opposed to copying these events for each player, is to have a single set that is smart enough to pick up on which controller is sending inputs and move the matching player sprite. I'll also have to set this up for animations and a dozen other things, but I think if I understand how to set it up for controllers, the knowledge will apply elsewhere.

    I'm going to play around with Functions a bit and see if I can get the desired result, but I thought I'd at least take a moment to clarify and thank you both for being so helpful. :D

  • EDIT: My topic name might be a bit misleading...I actually worked out half of the problem while typing that post...here's some clarification:

    I've created four Player sprites (Player0, Player1, Player2, Player4) on a blank layout, made them global, and I create them as needed on the start of a stage. Each one has a "Controller" variable with the same number as in their names. I want to use a single block of actions for all four player characters by matching the gamepad number with the "Controller" variable from the corresponding Player sprite.

  • I'm looking to create a game similar to Super Smash Bros, where four players fight in an arena setting. The issue I'm wrestling with at the moment, however, is how to streamline the addition of new characters for up to four players.

    Ideally, there's a character select screen with a number of characters available and four players (using gamepads) can select whichever one they like (even the same one multiple times). The problem I'm having with this is I don't know how to create four copies of the player sprite that can each be controlled and animated separately by each controller.

    I could do this by copying the basic control/animation functions four times for every single character, but that seems insanely time consuming and terribly inefficient (I'll have to repeat the process each time I add another player). Is there a better way?

    The way it works in my head is that the number of the controls would be relative to which number player sprite is moving. I can set this for the controller movements by giving each of the four player sprites a "Controller" variable numbered 0-3 and then making a function referencing the "Player.Controller" variable (so one event works for all four controllers), however, I don't know how to make it figure out which player to move.

    As it stands, it seems like I can only pick a single object to create the action from, rather than making it use "Player(Controller.Player)" or something to that effect (so Player0 is moved when controller 0 is pressed, Player1 is moved when controller 1 is pressed, etc).

    Sorry if I didn't explain my issue well, I'm still pretty new to Construct. Can anyone understand my problem and maybe help me find a solution? It would be greatly appreciated, especially since I don't want to get too deep into working on other aspects of this game if I find out that local multiplayer isn't feasible. D:

noisetank's avatar

noisetank

Member since 24 Apr, 2012

None one is following noisetank yet!

Trophy Case

  • 12-Year Club
  • Email Verified

Progress

13/44
How to earn trophies