Cameron9990's Forum Posts

  • > Or more particularly, how do I do an array or dictionary without it being like 500 events long

    Depends on what do you need it for.

    There are plenty of tutorials and official examples in C3, for instance:

    https://editor.construct.net/#open=level-selection

    So yes, I'm going to have to do on each individual card spawn, change some variable, so it's going to be like 500 events.

    Also, love how the clear button in their own example thing doesn't even work.

  • There are a few ways to do this. Most common method is to use an array or a dictionary to store the data about cards.

    You can also set card sprites as Global, then they will be transferred to a new layout. But be very careful not to duplicate them. If you have 10 cards on one layout and 20 cards on another, you can end up with 30 cards!

    Or more particularly, how do I do an array or dictionary without it being like 500 events long?

  • There are a few ways to do this. Most common method is to use an array or a dictionary to store the data about cards.

    You can also set card sprites as Global, then they will be transferred to a new layout. But be very careful not to duplicate them. If you have 10 cards on one layout and 20 cards on another, you can end up with 30 cards!

    I didn't realize that the location would be changed on every layout if I set them to global, so I guess I'll ask if there is any good tutorials on how to do an array or dictionary for this.

  • I'm trying to make a booster pack for a card game. I need to make it to where the game remembers what I pulled. I was trying to have it to where all the objects are in a family that has the instance variable of (Owned), and when one of them spawn they get +1 on that variable... but then I realized that as soon as I go to a different layout the variable goes away as it's a different copy of the sprite. Is there a way to do this easily, or am I going to have to do a ton of Global variables and do a on spawn event for literally every single card in the game to increase that variable by 1?

  • Minimaps are either a pre-rendered scaled sprite or drawn at runtime one pixel at a time.

    Decide the bounds and scale of your minimap, then loop through each pixel setting it to a color corresponding to the tile it represents.

    So what, code in each individual pixel?

  • I mean... that's self explanatory. My game is made out of a tilemap and I want to make a minimap. It's also large scale open world so the minimap would probably have to be zoomed in. Anyone got any advice or know a good tutorial for this kind of thing?

    Tagged:

  • Check that there are no other objects with active ScrollTo behavior. If there is ScrollTo on the player - remove it.

    There is not, it's just very slight motion blur that it doesn't have when my player has move to.

  • On Every Tick: System scroll to (Player.x+100, Player.y)

    You can also use an invisible sprite with ScrollTo behavior, and move it to those coordinates using MoveTo behavior for smoother scrolling effect.

    The issue I keep having is just that the player spright becomes slightly blurry when moving.

  • I need my camera to follow the player at an offset since I have the UI cover the rightmost 4th of the screen, I want the player to be centered to the remaining amount of the screen.

  • There are few ways to do so depending on how you want it

    You could use the los to detect when the player is close enough in viewing range

    or

    you can give your ai a number variable call it dist then make an every tick and do set dist to distance(player.x,player.y,enemy.x,enemy.y) then just compare the distance

    Or

    Make a If hit boolean then compare player.x to enemy. X then simulation control you could use timers to let them know how long to runaway for

    Me realizing I forgot to mention it's 8 direction movement with the enemies being solid so they can't run through the player. Like if it were a platformer this would be easy, it's just the fact that it's 8 directions so I can't just say an X value or they'll have times where they're just trying to push into the player when they're supposed to be running away.

  • You will need to have a list of actions for your enemy then apply the value to variable:

    0: run to player

    1: hit player

    2: run away

    If the variable = a number action, proceed enemy to do that action.

    That... didn't answer the question on how to do #2

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In my game I want one of my enemies run upto a player, hit them, then run off, then run back and hit them again and repeat. How would I go about that?

    Tagged:

  • I'm trying to have an enemy that runs at you, then when they hit you they back away then come back. So it can be them moving away from the player as apposed to there being a force applied to them, that works too, I just need them to back off.

    Tagged:

  • Some workaround that might work for your case: construct.net/en/forum/construct-3/how-do-i-8/retreating-ai-173846

    ...I mean, you saw my code. I just have that but with more extra bits. Also for some reason with the pathfind to the player, they just stop moving, that's why I'm using move to, to move them along the path.