How do I simplify code?

Get help using Construct 2

Post » Thu May 29, 2014 9:54 am

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
You do not have the required permissions to view the files attached to this post.
B
3
Posts: 4
Reputation: 183

Post » Fri May 30, 2014 12:05 am

@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
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » Fri May 30, 2014 1:03 am

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.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » Fri May 30, 2014 8:28 am

Thanks Aphrodite!. I'm going to study your improvements carefully. I really appreciate your contribution and time dedicated.
B
3
Posts: 4
Reputation: 183

Post » Fri Jun 06, 2014 7:55 am

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
You do not have the required permissions to view the files attached to this post.
B
3
Posts: 4
Reputation: 183

Post » Fri Jun 06, 2014 9:18 am

@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.
You do not have the required permissions to view the files attached to this post.
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,708

Post » Sat Jun 07, 2014 6:36 am

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.
B
3
Posts: 4
Reputation: 183


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 12 guests