Miyavi's Forum Posts

  • "Every X seconds" is not affected by the framerate - it runs based on real-world time rather than ticks.

    However, I think a few people are being thrown off by a current bug in Chrome 18. If there is nothing changing on the screen, the game will start running at hundreds of frames per second and the timers all screw up. The fix is to make sure you change something every frame - try just putting an unused text object outside the layout and always set it to tickcount to fix it.

    The problem should not happen in any other browser and is also fixed already in Chrome 19 so should disappear in a few weeks.

    Thanks a lot for this.

    I was actually going mad over it already, as my timer would decrease at a random speed when idle'ing.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Two booleans, one for each player, which states whose turn it is.

    When the turn changes (its boolean turns off), the timer is reset to 30.

  • So.. I just set the timer, but a funny thing happens.

    If I'm moving, or attacking or whatever, it goes correctly, but if I just idle, my time runs out way faster.

    How I implemented the timer is with a variable which decrements per 1 each second...

    EDIT:

    Ok.. related to the timer behaviour, I just found this, so it's a Chrome bug.

    Also, new version...here

  • Thanks Kyatric, I'll check it up.

    I'm actually implementing a timer and score based on the level left time, nothing too fancy :P

    Is there any way to freeze the game until, let's say, I press a button?

    In my game, if I die, the enemies keep shooting at something, so I want to freeze the game.

  • Yeah, I meant that.

    I didn't try that out, since I wasn't in the need to do so, but it's nice to know, if I ever need to do it (which I will :P)

    By the way, what about making a class which entends from another one?

    For example, I have enemy1, which is an archer, indeed.

    I want to have a class "Enemy", and some types of enemies, who will extend from Enemy.

  • Wow, thanks, Kyatric... so it was me, not doing it correctly.

    I'll check those threads right now.

    By the way, is there a way to change an object name, so it updates the actual "code".

    I mean, if, for example, I decide to change my "enemy1" name to archer, could I do it so I don't have to manually change everything on the actions/events? (As done with search and replace, in usual programming)

  • Sorry, I re-structured my dropbox yesterday, and forgot to upload the new .capx

    Here's the new one

    Also, I've tried doing what you say.

    I declared an instance variable for enemy1, which is a boolean, and I switched it on when they collided with my active zone, but it was just the same, every enemy would attack me, although they weren't in my active zone, so it's like all their boolean var would switch at the same time.

    I haven't looked into arrays nor UIDs yet, but AFAIK, every created object has a UID, so I could store the one colliding to my player's zone in an array.

    I'll have to look it up.

    Here's the new playable content, too.

    Greetings,

    Miyavi.

  • No one could help me out?

  • Hello everyone.

    I'm new around here, although I've been reading some tutorials and trying some stuff out.

    I'm actually working on a game. It's an arcade game, in perspective.

    Some friends are working on the artistic part of it, so I am currently working with own-made boxes.

    Basically, I have an area, surrounding my player character (pinned to it), and if an enemy gets into the area, it should react by shooting at me, and moving towards me.

    The problem I'm having is the following one:

    When an enemy enters into my "area", ALL the enemies start to shoot me, while I only want to shoot me the one inside my "area".

    How can this possibly be done?

    I've settled a health counter for the enemies, which work great, and it's independant for each enemy, but I've tried adding a boolean, which settles if it's inside the area, or not, but still, while doing so, all the enemies attack me.

    It's like that boolean would be linked to them all, and would switch for them all at the same time.

    Also...and I'm currently working on this, how can I make the enemies to shoot at my position, instead of "straight".

    Thanks a lot for the help provided,

    Miyavi

    Get the capx

    Edit:

    Already managed to shoot at my position.

    Also added a decreasing life bar, but it's anchored to the screen, and if you realise, whenever you move, it vibrates horizontally.

    How could I solve this?

    Also, link to playable content

    Edit2:

    I already solved enemies chasing me.

    Yet, I have no clue on how to make the enemy that enters my active zone (and not them all at once) to chase and shoot me.

    Any helping hand out there? :)

    I guess it has to be done with UIDs, right?