-
-
Save codeforfun-jp/a3eac27085797945433abf6d7de98ae0 to your computer and use it in GitHub Desktop.
CTB 3-1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package jp.codeforfun.catchtheball; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.view.MotionEvent; | |
import android.view.View; | |
import android.widget.ImageView; | |
import android.widget.TextView; | |
public class MainActivity extends AppCompatActivity { | |
private TextView scoreLabel; | |
private TextView startLabel; | |
private ImageView box; | |
private ImageView orange; | |
private ImageView pink; | |
private ImageView black; | |
// 位置 | |
private float boxY; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
scoreLabel = findViewById(R.id.scoreLabel); | |
startLabel = findViewById(R.id.startLabel); | |
box = findViewById(R.id.box); | |
orange = findViewById(R.id.orange); | |
pink = findViewById(R.id.pink); | |
black = findViewById(R.id.black); | |
orange.setX(-80.0f); | |
orange.setY(-80.0f); | |
pink.setX(-80.0f); | |
pink.setY(-80.0f); | |
black.setX(-80.0f); | |
black.setY(-80.0f); | |
startLabel.setVisibility(View.INVISIBLE); | |
boxY = 500.0f; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment