Being an album I realized that I lived meléndez channel easy tuto has challenged me to be a speed coding of a calculator in
facer so we accept the challenge
Ah
I look
to
Ah
yy
and me 2
I ah
Ah
to
I looked
Oh and
yy
and me 2
to
Ah
Oh and
I
I a
But
to
Oh and
and ah
and well here is the calculator between what I delayed most is to make the sprites
and in the code, I folded so much but nevertheless the whole
it took 90 minutes
it was a fun challenge and let's see what we've done
Well a visual struckow from above in assets load in my images with an atlas
load the sources that I made
and the display that also says
inside is all loaded in burladero I have loaded the source here I have started
the calculator scene
is here
and to begin with I added the start screen has created a counter for you to add
the numbers on the display
the current operation so that the function that is executed with the functions is saved
of being a function of multiplication and addition
the equality if the equal has been touched so that the previous and psychic number is maintained again the number is changed
here is the display loaded
for what
here I have loaded the text to the display
and here I started to create groups of buttons usually loaded the zero button because that is
of each button to zero and then there was 1 the 1 would be the effect of each button then loaded only 0
in the video he had some small inconveniences that he had to
correct here
If you set the button for example to this button 1 that would be the one without pressing
Also here the name is repeated and this is added to indicate that the inconvenience was pressed was that I did not think well in the order
and I had to start erasing each one but they are things that happen
Then you actions to make the scream of
of the calculator this gray from here
It has been ordered and we start animating once the buttons are converted into areas that can be applied
learned about the group and then I have done point winter down so that when click is
I charge the previous animation that by the way I think it does not look like this so I could erase it
Y
assigned the animation of when you are pressing
filling and the other one is loaded
in the sprite
effect of an error and here is a point that remains to be hot but hey I'm not going to give you the video just for
that
and then here and in alcoy trap that when it rises I assign
previous texture and I keep the name on buttons
Previously
this is for when it has been applied if it has been applied as well as to restart it
But you can already investigate this and the most important thing would be this switch on the switch s pressed the button
10.1 button 3 everyone has the operation I had thought that
use the functions are fixed
here I have a compass worth that we'll leave for the moment here I have to do parce and precision to avoid the
0.0300 just so much
I have the basic functions of editing addition and subtraction multiplication done something called currín
means that a value is going to be assigned first and then we wait to assign another value and it will return all
so thanks to that
and assign the value first to have it ready and then when the equal is pressed and to do the operation
Here this current operation that would be the operation that has been assigned to straight sum or whatever
you miss your foot on twitter
here it is
is a compost that the composer makes is going to pass the parameter that we put
this function will be executed and then it will execute this function that first happened to the precision and then it passed the float patch
because what precision does is leave the zeros if for example
is
0.3 at the end add
his other prison heroes to make tests of editors is worth the logical function what he does is to choose the name and compare
compares a name and assigns the button that is next 89 etc.
If you do not touch anything, you return nothing
and all that is done when you push
Until the name is assigned tivo more logical counter and they are added
If we had all this logic I thought previously this video would not have lasted
90 minutes but of course when developing the video you have to think all this
If you have not previously chewed, it takes a lot of time in this video to see how an application is really developing
Towards the design then it is passed
with drawing the part d
of the sprites and then in the course I'm doing the logic this base is here
this would be kind of like the draft of the application
I'm not going to
I'm not going to refractory set sail this but this I will leave it as it is because it is a draft and it works
Well I think the calculator is pretty good
and I can remove certain things
and as I said if all this was already thought, it would not last five minutes to live, it would simply be to copy everything.
some functions that I did not remember that were like this one that is to fill
and so you can write
from left forgiveness from right to left
Because otherwise
would begin to be written from left to right and if the number starts from here and already putting the numbers to the right
From there if they are fixed with few things that gives us facer we can go making a simple application like a calculator
if it took 90 minutes but because I had not thought about this code
so it's been great to do the calculator and the next one that I'm going to challenge is matías the fury code so
a description will be the challenge
and now it will be up to him to do what he loves to see how it develops in color
see you remember to subscribe comment and until next time
Không có nhận xét nào:
Đăng nhận xét