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
private void setupGrid() { | |
rows = (int) Math.sqrt(NUM_SQUARES); | |
columns = (int) Math.sqrt(NUM_SQUARES); | |
squareHeight = HEIGHT / rows; | |
squareWidth = WIDTH / columns; | |
} | |
private void drawGrid() { | |
for (int x = 0; x < rows; x++) { | |
for (int y = 0; y < columns; y++) { |
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
Compound board = new Compound() | |
private void initBoard(int fieldWidth, int fieldHeight) { | |
board = new Compound(0, 0); | |
for (int x = 0; x < ROWS; x++) { | |
for (int y = 0; y < COLUMNS; y++) { | |
Chessfield newField = getNewFieldForBoard(x, y, fieldWidth,fieldHeight); | |
board.add(newField); | |
} | |
} |
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
var canvas = document.querySelector("#canvas"), | |
context = canvas.getContext("2d"); | |
// Zeichne eine Linie von x1,y1 nach x2,y2 | |
function drawLine(x1, y1, x2, y2, color, weight) { | |
context.beginPath(); | |
context.moveTo(x1, y1); | |
context.lineTo(x2, y2); | |
context.strokeStyle = color; | |
context.lineWidth = weight; |
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
import de.ur.mi.graphicsapp.GraphicsApp; | |
import simulator.ColonySimulator; | |
import world.ColonyView; | |
public class AntColony extends GraphicsApp { | |
private static final int WIDTH = 300; | |
private static final int HEIGHT = 300; | |
private ColonySimulator simulator; | |
private ColonyView view; |
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
/* eslint-env browser */ | |
/* eslint-disable no-console */ | |
import Config from "../utils/config.js"; | |
import Pattern from "../game/Pattern.js"; | |
import Level from "../game/Level.js"; | |
import Game from "../game/Game.js"; | |
import View from "../ui/View.js"; |
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
name: Minimal Android CI Workflow | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- 'v*' | |
jobs: |
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
test |
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
public class BouncingBalls extends GraphicsApp { | |
private static final int CANVAS_WIDTH = 1280; | |
private static final int CANVAS_HEIGHT = 360; | |
private static final Color BACKGROUND_COLOR = Colors.WHITE; | |
private static final int DEFAULT_SPEED = 5; | |
private static final int MIN_SPEED = 1; | |
private static final int BALL_RADIUS = 25; | |
private static final Color BALL_COLOR = Colors.RED; |
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
public class BouncingBalls extends GraphicsApp { | |
private static final int CANVAS_WIDTH = 1280; | |
private static final int CANVAS_HEIGHT = 360; | |
private static final Color BACKGROUND_COLOR = Colors.WHITE; | |
private Circle circle; | |
private boolean isMovingRight = true; | |
private int currentSpeed = 10; |
OlderNewer