here we increase this to 10
is another record that use more forward to make a comparison Con 3 record we put this one
that would mean we already arrived head once the food so it’s going to
help assign a new position it will be a queue also use
these records for con6 CON7 same purpose after we have called
and compare and done me the comparison if the food has been the same
to the head He has done all this but me
initially he had returned the me returns to where we came here it was
It was right where we started and after comparing calls me grow
This growth will be valid only in the case where food and has
It has been equal to the head just so con3 use the records, which we mentioned earlier in con6 compare that we use here in the subroutine grow
if Con 3 and is 1 means there is already a food so I was going
to come here to generate a new tail and the new queue I will generate
making a rotation rotation head we will save about 2
new in new two registers once you have done this to grow,
good in the case that grow there been nothing more than a tail bone already
two tails go for that use case seven accountant who was also
to compare and use this pulpress we mentioned before is the
I will save the positions of the past the last button there
been activated in this case what We do is compare the last button
which is assigned depending on last button which is assigned
we keep the position of the queue numbers on two new in
new records that as we have always used is two one for
column tail and one for rows in the intersection will give me a point
the matrix here to grow we do this for each push button
You have pressed the button depending pressing the rotation is indicated that we do here in this subroutine
given that we have called grow this value all this only makes the
if program already has more than a queue or whether they and the little snake
already have three points drawn in matrix if it is not him only from this
I will return here before get to the counter 7 is not necessary to reach
there when when all when just It has grown one you see the snake once we have called grow and we return back here where
We came here use this record pulp previous press him to let
used to maintain the value penultimate push button switch that
we have activated which we will use to rotate when when there is already a third
tail for so little snake depending on this button will also make indicated rotation and not go to me
generating any error we are in this subroutine and
we have called right right means the snake is turning
right so what we do is rotating columns which in this case
They will be the port C to rotate left and according to value
the pins that we have assigned the port C in the matrix and is she
little snake will turn me right and here We keep current positions
we made after rotation in our head fixed values ​​that are
column and row here we do something that we
done before it is reset the registers, counters we are
using for generating the value Random food is this This action here what I will do
is correct rotation if I have made an error in case the
C status bit has put me 0 0 placed a bit to least
significant because the rotation is left or if it has been
one placed him on January 1 that’s what makes me what I am
doing is correct rotation verifying that it is correct then what
I do in this section is the same I’ll do here in case there
been one so we created this sub continuader routines to repeat me
so what I was done before me after that that we have done
this call display rotation is a subroutine that we did to create the
sweep matrix to generate each each
value here is the casting call I subroutine will be stored
values ​​if casted yaya has generated a second tail
that would be would be two tails head three points is also
We have here created subroutine tail which it has the same principle
Strained is that which also We call on display here for the
and scanning and display me in the womb here we call tail also
We call the current values ​​or food and the current values ​​of wall and
We use a kind of counter here with this record that what is me
do not get is that while I this I value it will repeat the latter
Action then I will be drawing the
values ​​that I gave that up here wall are cast as if
and there is also food and avoid avoid the creation of
delays then once done him subroutine returns to our
we were right and it was making me It is call buttons without left
because this is the Culebrita If this subroutine is turning
right as we had explained what makes this subroutine
buttons without izquierdasya understand because let’s call this and the same
we do with each subroutine exactly the same with the left subroutine
which means that the snake will the left with a subroutine under that
It means going down with the subroutine that means going up
up we do exactly the same and finally we have created a subroutine apart which is in the case where column head which equalizes
means that we have lost so the missed call then what we do is draw a
p in the matrix why we We assign ports multiple values ​​and
We do another sweep of the matrix aid this counter again
we have already used in display We do a sweep of the matrix
Further delay is that call this delay we have created here that is
we did it with one timer once this is done it means that the
player has lost let’s started again and the game is restarted

32 thoughts on “SNAKE GAME ENSAMBLADOR 2

  1. amigo, me encantaría me lo mandaras a mi correo pero si lo tiees en RADAMS, xfis solo lo básico.

Leave a Reply

Your email address will not be published. Required fields are marked *