263264265266267268269270271272273
return Singleton.getPhysics().getLinearVelocity(entityName); } @Override public boolean getEntityHasItem(String entityName) { WorldEntity we = m_state.getWorldEntities().get(entityName); if (we instanceof WECar) { WECar car = (WECar) we; return car.getInventory().hasItem(); } return false;
273274275276277278279280281282283
return false; } @Override public void resetEntity(String entityName, Vector2D position, float rotation) { WorldEntity we = m_state.getWorldEntities().get(entityName); if (we instanceof WECar) { Singleton.getPhysics().resetBody(entityName, position, new Vector2D(), rotation); } }
2728293031323334353637
public void action(RaceGameState state, WECar car) { //car.applyPowerDown(); if (Singleton.getOptionsController().getRole().equals("SERVER")) { HashMap<String, WorldEntity> entities = state.getWorldEntities(); for (String s : entities.keySet()) { WorldEntity e = entities.get(s); if (e instanceof WECar && e != car) { WECar c = (WECar) e; c.applyPowerDown(); } }
384385386387388389390391392
//COnfigura o mundo private void initWorld() { worldObjects = new ArrayList<WorldEntity>(); worldObjects.add(new WorldEntity(100,0,80,200, GameDef.TEXTURE_WOOD)); worldObjects.add(new WorldEntity(300,0,80,200, GameDef.TEXTURE_WOOD)); }
238239240241242243244245246