Files
SMIMS_2026_1/fighter/MyWorld.java
T
2026-09-15 09:49:28 +02:00

35 lines
822 B
Java

import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class MyWorld here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class MyWorld extends World
{
/**
* Constructor for objects of class MyWorld.
*
*/
public MyWorld()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(600, 400, 1);
prepare();
}
/**
* Prepare the world for the start of the program.
* That is: create the initial objects and add them to the world.
*/
private void prepare()
{
player1 player1 = new player1();
addObject(player1,125,153);
player2 player2 = new player2();
addObject(player2,429,152);
}
}