reymesson1 / android-ejercicio4

0 stars 0 forks source link

Choque #3

Open reymesson1 opened 5 years ago

reymesson1 commented 5 years ago

override fun onTick(l: Long) {

            timeLeftInMilliseconds = l
            var params = blocks1.getLayoutParams() as LinearLayout.LayoutParams
            var paramsBullet = bullet.layoutParams as FrameLayout.LayoutParams

            params.setMargins(90,moveBlocks,0, 0)
            paramsBullet.setMargins(90,moveBullet,0, 0)

            var rnds = (50..99).random()

            moveBlocks+=10
            moveBullet-=10

            blocks1.layoutParams = params
            bullet.layoutParams = paramsBullet

            if(moveBlocks.equals(moveBullet)){

                countDownTimer?.cancel()

            }

            updateTimer()

        }
reymesson1 commented 5 years ago

if(moveBlocks.equals(moveBullet)){

            countDownTimer?.cancel()

        }