How do I simplify code?

0 favourites
  • 7 posts
From the Asset Store
5 levels with simple coding Source-code (.c3p) + HTML5 Exported
  • I'm trying to make a educational game for writing. Attached my .capx for writing letter A. I'm a beginner and I think I am complicating too much the code. Too much events for a simple thing. I request from more expertise people some ideas to simplify it.

    Thanks a lot

  • celescu : I am looking into it, I saw what I think are a bad use of "for-each", since the conditions used after are already implying to be "for-eached"

    I continue to look, nice idea btw

  • Here are my edits: https://dl.dropboxusercontent.com/u/100 ... dited.capx

    In retrospect, It is not really less complicated, but it should be more compatible (I corrected a few bugs I've spotted, and also now instead of relying on a number of Letra and Letra1 you've counted, it counts them itself, so you should be able to use it directly for every letter, as long as each letter is in it's own layout that is)

    I've added comments so I hope you understand it well.

  • Thanks Aphrodite!. I'm going to study your improvements carefully. I really appreciate your contribution and time dedicated.

  • The hard work is done. Attached .capx. Still missing sounds and minor improvements.

    Now the question is other one. I`ve made a layout for each letter. This can be problematic if I want to enhance the project. My question is, how do i create with only one layout with the sprites representing each letter with its respective instances?

    For instance: I choose letter A in menu, then the position of each sprite shows letter A. If i come back and choose letter B, the same layout is modified to show this letter.

    I guess It`s something related with arrays, but i cannot imagine how. All kind of suggestions will be appreciated. Thanks

  • celescu,

    O' My - You need to simplify it.

    I don't have answer, but thought another way to handle it might be use imagepoints and animation frames for each letter.

    Attached is quick demo that isn't working properly (lack of time to make it work correctly, but the idea is viable)

    It is a quick mock up and not intended to work, only to test a theory. The idea is to NOT use multiple layouts when 1 can do. Going for Simplicity.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks Dutoit! Very original and useful sollution. I'll try to adapt it to my previous work.

    But I am still thinking about the problem of placing sprites in their positions at start of layout with their appropiates instances. I'm sure this issue have to happen in other kinds of games but I don't find any sollution yet.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)