基于android的俄罗斯方块的设计与实现课程设计报告(编辑修改稿)内容摘要:

m_started = false。 ()。 m_timer = null。 notifyGameState()。 } private void notifyGameState() { Message msg = new Message()。 =。 (msg)。 } private void notifyScore() { Message msg = new Message()。 =。 (msg)。 } private Shape getRandomShape() { Shape shape = null。 Random r = new Random()。 int ran = (()) % 8。 switch (ran) { case 0: shape = new Point()。 break。 case 1: shape = new Bar()。 break。 case 2: shape = new LeftCorner()。 break。 15 case 3: shape = new RightCorner()。 break。 case 4: shape = new LeftCrutch()。 break。 case 5: shape = new RightCrutch()。 break。 case 6: shape = new Hill()。 break。 case 7: shape = new Square()。 break。 } return shape。 } public boolean down() { synchronized (m_table) { clearShape(m_row, m_column)。 boolean move = move((), m_row + 1, m_column)。 if (!move) { recoverShape((), m_row, m_column)。 return false。 } else { m_row++。 notifyUpdateUI()。 } } return true。 } private boolean up() { synchronized (m_table) { clearShape(m_row, m_column)。 boolean move = move((), m_row 1, m_column)。 if (!move) { recoverShape((), m_row, m_column)。 16 return false。 } else { m_row。 } } return false。 } private boolean move(Rectangle[][] shape, int toRow, int toColumn) { synchronized (m_table) { Listint[] coordinates = new ArrayListint[]()。 for (int i = 0。 i。 i++) { for (int j = 0。 j shape[i].length。 j++) { Rectangle rect = shape[i][j]。 if (()) { int row = i + toRow。 int column = j + toColumn。 if (row = || row 0) { return false。 } if (column 0 || column = m_table[0].length) { return false。 } Rectangle gameRect = m_table[row][column]。 if (()) { return false。 } else { int[] coor = new int[3]。 coor[0] = row。 coor[1] = column。 coor[2] = ()。 (coor)。 } } } } Iteratorint[] its = ()。 while (()) { int[] coor = ()。 int row = coor[0]。 int column = coor[1]。 17 int color = coor[2]。 Rectangle gameRect = m_table[row][column]。 (true)。 (color)。 } } return true。 } private int gainScore() { int lines = removeLine()。 if (lines 0) { int scoreBak = m_score。 switch (lines) { case 1: m_score += 1。 break。 case 2: m_score += 3。 break。 case 3: m_score += 6。 break。 case 4: m_score += 10。 break。 } notifyScore()。 if (m_score / 50 scoreBak / 50) { if (m_gapTime MIN_GAP_。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。