MikeDobson's Forum Posts

  • 7 posts
  • So ... "Introduce Yourself" ... Something besides "hello, world" I suppose!

    As you can see (@MikeDobson), my name is Mike, and I live in the U.S.

    "Hello, my name is Mike, and I'm obsessed with a computer game."

    I've been programming computers of one kind or another since Reagan was still president (not that those two facts have anything to DO with one another) ...

    And to further "date-stamp" myself, my very first "computer" was "Timex-Sinclair 1500" !

    It just occurs to me as I'm writing this, that my very first ever "complete" program, was in fact a very basic (no "splitting" etc. but did have "graphics" of a sort) "Blackjack" (or "21" if you prefer) game! I thought of it myself, did it ALL by myself - as opposed to modifying code from books or magazines, etc. (that was the way a lot of "hobbyists" spread code in those days).

    So far, I'm sort of using C2 as a "rapid" (relative term, there) "prototyping" tool, attempting to "re-create" an old "computer game" that's even older than my personal experience; maybe I'll get around to a "Work in Progress" and/or "Screen Shot" forum post eventually.

    It's taking me a bit to get "past" the whole "no coding required" type of "paradigm" (especially since I'm more familiar with "coding") espoused by C2; I'm seeing (though various tutorials and my own experiments) that it requires, if not explicit "coding," quite a few bits of rather "specialized knowledge" (which look suspiciously like things most learn w/"traditional" coding) in order to get very far past the simple(r) templates and "game genres" that the creators obviously had in mind for C2. Some 3rd-party plugins are already simplifying things tremendously, especially those by rexrainbow !

  • I believe it's on the TODO list

    Wow! Thank you, thank you, thank you, ramones !!

    Someone finally just threw the egg at my face, instead of bypassing the original question !

    Now, I've searched just about every way I could come up with, without finding ANY those posts you linked ?!

    At the moment (re-searching just to check) it appears that maybe I just didn't sift (yet) far enough down in my search results !

    In many of these posts, Ashley mentions the "todo list" ...

    Is there an "official" list posted somewhere publicly ?

    (haven't managed to catch that on a search yet either!)

    I've seen the release page, and I assume there's a "master" list somewhere, such that certain items get prioritized for subsequent releases while others stay "lower" on "to-do" status ...

    Again, I officially apologize for not searching diligently enough, and wasting anyone else's time !

  • if you don't see exactly:

    First Value:(Sprite.Boolean1 = 1) & (Sprite.Boolean2 = 1) & (Sprite.Boolean3 = 1)

    Is equal to

    Second Value: 1

    Just to clarify a bit ...

    Since the Instance Variables ARE evaluated as Boolean in the expression's "logical AND" operators, the explicit comparisons "=1" are actually redundant in this case. (even if they are implemented as 1/0 for true/false "under the hood")

    Actually, C2 logical comparisons, in general, appear to work with zero (0) as false and non-zero (?0) as true (rather than just 1) ...

    If you're any "good with Boolean logic" the following seems even less "annoying":

    (Sprite.Boolean1 & Sprite.Boolean3 & Sprite.Boolean3) =1

    [Edit]You DO need that last "=1" (C2 appears to have no condition for expression evaluation to Boolean ?) - you must have the "Second Value" even if it does happen to be redundant ...

    Perhaps more efficient at run-time also, but I have to idea how C2 happens to optimize generated code on export ...

  • Looking at the underlying technology of C2 (HTML5 / Javascript), I notice that all variables are ultimately without a type in their definition

    JavaScript uses dynamic typing most of the time, yes. That could lead to some interesting conversation, but that's not really my point. I didn't intend to get into any discussions of JS technology, language implementations, and/or script parsing/interpretation/compilation.

    With that said, I guess the Construct 2 editor tries to at least provide some structure by allowing variables to be specifically set to number or text.

    This statement sort of leads towards my original point. This "structure" is for the "convenience" of the "no programming" game developer, not the eventual JS run-time code.

    It seems possible to add the "type" of Boolean, but they probably also decided it was unnecessary due to the ability of Javascript to perform Boolean checks for most data types

    Not only "possible," but "they" already DID!

    That in fact, IS my "original" point: C2 ALREADY supports a "Boolean" interface & dialogs for Instance Variables (only), so why not for Global & Local Variables as well ? THAT is my question ...

    So, they probably figured it's easier to just invert a condition that checks "if X = 0" than to bother with all the extra code to support a fake type, that would lower performance during execution if it were enforced via variables declared as objects.

    Ok, I'm just guessing here, but it seems that the "enforcement" would be during the "design & development" using C2, not necessarily in the exported JS run-time code; if you "enforce" the "Boolean" within the design interface (C2 Boolean dialogs when "declared" as such Instance Variables), then you prevent the user from "accidentally" using it in any other manner, so as C2 generates the actual JS code on export, it should be able to guarantee that consistency. Exactly HOW the "Boolean" is "implemented" in the generated JS code ("if X=0" or whatever) should need be of NO concern to the game developer, as long as he does not (or is unable) to "mix" the types ...

    (Now, I'm by no means any kind of "expert" in the use of C2, but I'm also guessing that there are other ways of bypassing those "interface" restrictions, but then, you're getting closer to "real code" as opposed to the "no programming" mantra of C2) ...

    Once more, my only real issue here is:

    When it fits my design, I'd like to use a "Boolean" interface & dialog(s) for Global & Local Variables, in the same manner as already supported for Instance Variables, so why NOT ? ...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks to rezagamertag and Aphrodite for your replies over the weekend!

    I think I've at least inferred that the answer to my first question of "can it be done?" is probably "no" ...

    As to my second question of "why not?", perhaps Ashley or Tom will reply with a "definitive" answer !

    Maybe I'll review more of the Forums here, and see if there's a better place for a "feature request" kind of thing (as opposed to the "Bugs" sub-forum).

    From a "practical" POV, it is possible, perhaps even (not quite) "trivial" to "work around" the lack of Boolean type for Global/Local Variables, as mentioned already.

    However, you always have more "work" to do to get "around": you have to always remember HOW exactly you've done it - is it "False=0, True=1" (or True≠0), "True>0, False≤0" or "True=Yes, False=No" or "yes, no" (and handle case if necessary); or maybe even build your own "pick-list" interface to enforce your workaround ... Having to "keep track" of it, is the real "issue" for such workarounds, especially when it's already implemented in the tool.

    With the "real" Boolean, you simply pick "Is Boolean Variable Set" for an Event Condition, or in an Action, "Set Boolean" (thus ONLY allowing True or False is enforced) or (even more direct) "Toggle Boolean".

    From the POV of a tool intended for "no programming" this is not only "correct," but somewhat annoying that it's available only in some cases. I can just imagine someone with no programming experience trying to figure out why they can use easy/convenient Boolean types in Instance Variables, but not in Global/Local Variables (much less keeping track of more complicated workarounds).

  • You can use a text variable as a Boolean by either making it "No" or "Yes".

    Or you can use the number variable "1" and switch it by multiplying by "-1".

    Yep, the "text variable as a Boolean" workaround would seem to be an even worse choice than the "Integer as Boolean" one (I didn't want to say "kludge" but that's what it is) ... It might be more "readable" but theoretically, takes a bit longer to manipulate (although if you're looking at a "no programming" development tool, you're probably not concerned with this level of optimization) ...

    The "*-1 toggle" trick is "clever" but "works" only if you "test" by comparing with ">0" rather than "?0" ...

    Still, my question is why are "real" Boolean types not allowed in "Global" or "Local" variables ?

    This seems to be a rather obvious omission, and I'm just wondering if there's an explicit reason.

    PS: Further reading shows me that C2 actually DOES have some "bit-wise" capabilities (get/set/togglebit functions) but still the single bit can't be implicitly interpreted as Boolean (must be explicitly compared) ...

  • My first (in THIS particular forum, anyway, but probably not my last!) "stupid question" ...

    (if it IS really a "stupid" question, answered elsewhere, not appropriate for this forum, please advise)

    As far as I've been able to determine, Global or Local Variables can ONLY be "Number" or "Text" but NOT "Boolean"; ONLY an "Instance Variable" may be "Boolean" ... Did I miss something ?

    I'm a relatively "new" user to C2, but I've been programming more "conventional" paradigms almost as long as I can recall; I HAVE read a number of "tutorials" but have NOT read the ENTIRE manual; I HAVE searched repeatedly (scirra.com for Manual & Forums, also Google, etc.) for various combinations related to the above, to no avail ...

    The only thing that I've seen in forums as well as tutorials, is the age-old "work-around" of using a Global or Local numeric variable and "testing" it for either 0 or 1 (or slightly "better," just "not zero") to get a "Boolean" result of "False" or "True," respectively. Why should this be necessary if the "environment" already HAS explicit Boolean variables available?

    If I'm not missing something somewhere, and it's really NOT possible to create Global or Local Boolean variables, I'm curious as to why they would be limited in this way ? Was/Is there a specific reason for this?

    Please and thank-you! (in advance)

  • 7 posts