calebbennetts's Forum Posts

  • No problem!

  • I think what you're wanting to do is add the touch behavior and the buttons. Then, take each of your commands, make it an "or" block, then add in the new condition. For example:

    Keyboard: Down arrow is down => Player: Set direction to "Down"

    becomes

    Keyboard: Down arrow is down

    OR

    Touch: Is touching DownArrowObject => Player: Set direction to "Down"

    You keep all your old events: you just have to add conditions to them. As an added bonus, I think putting in touch controls like this automatically puts in mouse controls. I THINK.

    Eh, Steve!

  • I got a demo file working. Move the mouse around to scroll to different positions.

    https://drive.google.com/file/d/0B_yBalwF1wRjYlg0eHN1cndfYUk/view?usp=sharing

    Eh, Steve!

  • Do any of your objects have the "persist" behavior? If so, add "system -> reset persisted objects" to your event that restarts the layout.

  • What you might try is giving your player two copies of the 8-direction behavior. Set one to only left and right motion and the other to only up and down.

  • If you add the "persist" behavior to each of your objects that changes as the game continues (i.e. the player character and the monsters, but not the background), you should resume exactly where you left off. When you really want to reset things, use the system action "reset persisted objects."

  • There's a behavior called "Persist." Just give it to everything you need the game not to reset. When you actually want to reset the game, like when the player dies, add the action "System -> Reset Persisted Objects" in your events.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oh, okay. Thanks!

    (There's that solved)

  • It seems like most people on these forums have robots for their avatars, all in the same art style. I'm just curious, where do those come from?

  • You mentioned a problem with adding 500 to the character's vector x. I bet that is because of the platform behavior's "max speed." If you had events raise the max speed during the move and then put it back down when the move is finished, I think that would fix it.

  • I was just thinking of this. I'm gonna try moving every object some jump to the left when the player gets past a certain x-value and then destroy the terrain when it's outside the layout. I'll tell you if it works out.

    Update:

    Eeh... Not the easiest thing in the world. I think some infinite runner games move the platforms, not the player character. Imma maybe try that.

  • I'm sorry to hear about your mom. While I was writing this, the song "Only love can hurt like this" was playing in the background, and I think that means something.

    For your game, this seems doable.

    To spawn enemies, first make a spawner object. This can just be a rectangle with initial visibility false. Give it an instance variable, like "to spawn," and set it to the most enemies you want on screen

    For the conditions, use System: Every X seconds AND Spawner object: compare value: "to spawn" > 0

    For the actions, use spawner object: spawn another object: enemy AND spawner object: subtract from: 1 from "to spawn"

    To add back in to the counter, use

    enemy: on destroyed

    spawner: add to : 1 to "to spawn"

    Note: this assumes you're using only 1 spawner.

    For enemy movement, I just use

    enemy: compare x: > player.x

    enemy:simulate control: right

    else

    enemy: simulate control: left

    To jump, you could try

    enemy: is moving, invert condition (right click the condition and select "invert")

    enemy: simulate control: jump

    As far as making the boss, you would probably need a global variable like "points."

    Add the action "system: add to: 1 to points" to the enemy destroyed event

    Add the condition "system: compare value: points < (the number of enemies you want killed before the boss spawns)" to the spawning event.

    Add the new event:

    System: compare value: points >= (number to spawn boss)

    Spawner: spawn another object: boss

    And give the boss the AI you want, maybe the same as the base enemies.

  • Thanks! This should be just what I need. The reason I need the array is that I design several small sections of map and store them in array, then the game randomly chains them together by duplicating each section from the array's instructions.

  • I'm making a platformer game with a procedurally-generated world. The game makes chunks of map by spawning and giving properties to several sprites at a time based on an array. In other words, each x-value is a different sprite with all its properties, and all the x-values for one z-value are a chunk of map. Initializing the array is what gives me trouble. I know I can use JSON strings to load an array, but how do I make such a string? Is there a way to embed this string in my final game? Otherwise, I'm stuck writing to hundreds of array elements separately in one simply gigantic event. I'd appreciate any help you can give.

  • "Set layout scale" is also useful for #1.