American Young Coder

AYC logo
Loading Events

« All Events

  • This event has passed.

6 PM – Android Game Dev

July 30 @ 6:00 pm - 7:00 pm

Today We Did
  1. We calculated cellSize and change the apple and snake images according to cellSize.
  2. We added update method that can increase the x coordinate of the snake.
  3. We utilize invalidate() built-in method to force call the onDraw(Canvas) method.
  4. We were able to make the head moves to the right and when it hit the right edge, it will reappear on the left size.
Homework
  1. Change code inside GameBoadView.java
  2. Create List<Bitmap> headImages = new ArrayList<>();
  3. Store all 4 images of the head into above list.
  4. Everytime you draw the head image on the onDraw(Canvas) method, rotate through the head images inside the List. So rotate from the 1st, 2nd, 3rd, 4th and back to the 1st image of the head every time you draw the head image. Hint: you need to keep track of the index of the head that you want to draw.

Details

Date:
July 30
Time:
6:00 pm - 7:00 pm