NickRimer's Forum Posts

  • frostyelk is right!

    another advice will be to make a Constant to store this initial value.

    it will save you later from remembering when you store what value and probably from logic mistakes.

    Example:

    constant INIT_TIMER = 20;
    var Timer = 0;
    <...>
    Timer = INIT_TIMER; //reseting your value to initial
    [/code:19hndrk4]
    
    now you need just to change INIT_TIMER at the top of your event sheet.
    very useful if you use this reset in several parts of your game.
    or you will need to search and change values in all this places.
  • Ha! It's freaking easy, dude..

    Let's consider that first state is play. And music is playing. So..

    var Button.State = 'play';
    <...>
    On Button clicked -->
         If Button.State = 'play' then {
              <pause music>;
              Button.State = 'pause';
              Button.Text = ' ► ';
              }
         Else if Button.State = 'pause' then {
              <resume playing music>;
              Button.State = 'play';
              Button.Text := ' ▌▌'
    [/code:hq50qlw4]
  • try this: right click on any block and toggle on Make 'or' block function. Now all conditions in this block will be separated by OR (not by AND as by default)

  • TextBox -> Set Focused[/code:2hs55f70]
    but there is no ways to check is control in focus or not, you need to make it manually with some var
  • Hello!

    My customer wants me to use his ad banner code inside application.

    This is html-tag code with tags: script, ins.. this is it:

    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-403xxx581xxx99xx" data-ad-slot="5xx5xx8xxx" data-ad-format="auto"></ins><script>(adsbygoogle = window.adsbygoogle || []).push({});</script>[/code:3r7wjyj3]
    Usually it just inserts into html page and no problems. But if there any way to use this code inside c2app? Any suggestions?
  • you can use TextBox to allow your teacher to write questions

    you can use Array or Dictionary to store your data (both questions and answers)

    you can use their save/load functions to store and restore data in JSON format

    all other is your imagination and experience to make game mechanics

  • now.. I understand.. I think..

    you want to kill just monster you clicked on, even if bullet will fly through hordes of other monsters to reach your aim? we need to kill just clicked one and save others, yes?

    ok, let's do something like that:

    create global var ClickedMonsterID first

    I don't know you want to use mouse or touch, but let's use touch, it can simulate mouse by default

    Touch -> On tap monster
         ClickedMonsterID = monster.IID (or UID, no big difference for our example I think)
         <launch bullet with your parameters>
    
    On bullet collision with monster
         If monster.IID (or UID) = ClickedMonsterID
              bullet.Destroy
              monster.Destroy[/code:2wmzfc9o]
    of course, it can slow down game performance because of too many collision checks.
    
    Another way is better on my look but not so good because of one moment..
    So.. take all your monsters and toggle off [i]Collision[/i] property (to Disable value).
    And then code will be much easier:
    
    [code:2wmzfc9o]Touch -> On tap monster
         monster - Set collisions enabled = Enabled
         <bullet fire>
    
    On bullet collision with monster
         bullet.Destroy
         monster.Destroy[/code:2wmzfc9o]
    So, there will be just one monster who can collide with bullet.
    I don't know will it work or not, but you may try it. But you can use it only if you never need constant check of any other monster collisions (with obstacles for example).
    
    Try both and say your opinion.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • emm.. when you check collision between monster and bullet, monster will be picked!

    On bullet collision with monster
    monster - Destroy[/code:h6mocc86]
    no need to pick this monster specially
    
    must work
  • Maybe my decision is very bold.. but..

    On laser collision with asteroid do: System -> Compare two values

    If you check by IID, smallest will be always 0. So check if asteroid.IID = 0 then...

    Also on collision you can assign var HitID = asteroid.UID

    Then just make some loop:

    Var min = 255
    System -> For each asteroid
         if asteroid.UID < min
              min = asteroid.UID[/code:wbx0bm0i]
    After loop end check, if min = HitID, you collide smallest UID asteroid.
  • Sorry for my BUG report. Because it's really NOT A C2 BUG!!!

    I've just made a very deep analysis of font files downloaded from that resource..

    And I notice that there is a data damage in cyrillic symbols!!!

    I will use another web-font-convert resource to achieve needed results.

    Sorry for wasting your time.

  • Problem Description

    As you can see in my profile I'm from Russian Federation, so cyrillic support is very necessary for me.

    But using Set Web Font action I can't take needed result. I see just some standart font (or RARE only some letters are looks like new font, but others - by default).

    This app was checked by some my friends in different ways of country - one result.

    Also I've checked different fonts. All checked fonts supports cyrillic char sets. I usually download them here: h-t-t-p :// ru (dot) fonts2u (dot) com

    Is it a bug or you just have no support for any char sets instead of latin?

    Can I dream to achieve this support in future?

    If there is no and will no support for my problem I understand that the only way is to use uncomfortable in preparation and using Sprite Font?

    Attach a Capx

    [attachment=0:1kdo69ko][/attachment:1kdo69ko]

    Description of Capx

    Capx does only Set Web Font action.

    You can find there 2 Text plugins with test phrases: upper - in russian, lower - in english

    Project contains 5 files: 4 different types of one font and stylesheet.css to describe them.

    Steps to Reproduce Bug

    • Just start preview

    Observed Result

    English text will take new style. And russian will not.

    Expected Result

    Both texts must take new style.

    Affected Browsers

    • Chrome: YES
    • FireFox: YES
    • Internet Explorer: YES

    Operating System and Service Pack

    Windows 8.1

    also checked in Windows 7 SP1 and WinXP SP3

    Construct 2 Version ID

    C2 beta r198 (Steam version)

  • so you need to understand what bullet is for what monster

    you can pick needed monster by his IID (for example)

    every bullet - some var instance, ex. MonsterID

    after shot make Bullet.MonsterID = needed Monster.IID

    then in cycle for every bullet you need to pick monster with IID = bullet.MonsterID and then Bullet -- set angle towards -- monster.X, monster.Y

  • Kill both 12 and 13 sub-events.

    Make an event (NOT sub-event) Bullet -- On collision with... Monster --> Bullet.Destroy

    Make an event (NOT sub-event) System -- Every tick --> Bullet -- Set angle Towards Monster.X, Monster.Y

    Why Bullet spawns Bullet? I think Player must spawn Bullet.

    Mmm.. try it. I think it will be more correct.

  • Hello men!

    This is your capx-source.

    I hope that it will be easy for you to understand all its mechanics.

    There are some comments inside, but if you want more - write me a personal message or post your questions right here! I'll give you all support on my capx-source.

    Attached image shows array structure.

    X-axis means monsters, Y-axis means heroes. Each index is a proper instance of monster/hero.

    Value on (X,Y) coordinates means == hero with (IID = Y) deal Value damage to monster with (IID = X)

    After monster death we search for maximum Value in a column with number equal to this monster IID.

    Y coordinate of this Value will be IID of hero who dealt max damage.

    Enjoy!

  • check this: maybe you made a Trigger once sub-event