附加在Python游戏中

时间:2017-01-14 20:02:41

标签: python turtle-graphics

number_of_enemies = 5
enemies = []
for i in range(number_of_enemies):
    enemies.append(turtle.Turtle())
for enemy in enemies:
    enemy.shape(enemys)
    enemy.penup()
    enemy.speed(0)
    enemy.setposition(random.randint(-245, 245), random.randint(-245, 245))

我想分别召唤每个敌人,但我不知道怎么称呼他们

1 个答案:

答案 0 :(得分:2)

你究竟是什么意思"打电话给"?

public class MapsFragment extends Fragment implements PermissionsFragment { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ll = (LinearLayout) inflater.inflate(R.layout.fragment_maps, container, false); mMapView = (MapView) ll.findViewById(R.id.map); ll.setOnTouchListener(new View.OnTouchListener(){ @Override public boolean onTouch(View v, MotionEvent event){ Log.e("INFO", "Touched"); return true; } }); } } 获得第一个敌人