Skip to content
Snippets Groups Projects
Commit dbf20022 authored by kaj's avatar kaj
Browse files

Images,creation d'un "tutoriel", et debut de jeu

parent 8919de6c
No related branches found
No related tags found
No related merge requests found
TODO 0 → 100644
A faire :
-Rajouter un moyen de racheter des vies
-Rajouter une preview de la prochaine vague
src/main/resources/big_kinght.jpg

14.7 KiB

src/main/resources/big_tower.jpg

13 KiB

src/main/resources/faible_kinght.png

8.34 KiB

src/main/resources/faible_tower.png

13 KiB

src/main/resources/gold.jpg

25.2 KiB

src/main/resources/heart.png

8.62 KiB

import swing._
import java.awt.Dimension
import GUI._
import Gamelogic._
object simple_field extends abstractGrid
{
var path = List.tabulate(simple_field.Legth)(n => Position(n,5))
var nexusHP = 100
}
abstract class Cell extends Button
{
var x:Int
var y:Int
def info(field:abstractGrid):Entity
}
abstract class abstractGame
{
/** representation of the field with the towers and monsters */
var field = simple_field
/** number of waves already beaten by the player */
var wavesNumber:Int = 0
/* amount of gold the player has */
var money:Int = 150
/* number of life the player has */
var life_count:Int = 3
/* describe the part of the game currenly in place*/
var mode:String
def display_grid(field:abstractGrid):Unit = ()
}
import swing._
import java.awt.Dimension
import GUI._
object NotImplementedDialog extends Dialog
{
......@@ -14,7 +15,7 @@ object TowerDefense extends SimpleSwingApplication
{
val topLabel = new Label("Welcome to TowerDefense")
val tutoButton = new Button(Action("Tutorial") {
NotImplementedDialog.open()
Tutoriel.open()
})
val playButton = new Button(Action("Play the game"){NotImplementedDialog.open()})
val exitButton = new Button(Action("Quit game") {System.exit(0)})
......@@ -34,3 +35,12 @@ object TowerDefense extends SimpleSwingApplication
}
}
}
object Tutoriel extends Dialog
{
contents = new BorderPanel
{
add(new Label("Le but du jeu est defendre le \"nexus\" pour cela il faut poser des tours en dehors du chemin pris par les monstres"), BordelPanel.Position.Center)
add(new Button (Action("OK") {close}), BorderPanel.Position.South)
}
}
......@@ -8,8 +8,14 @@ import GameLogic._
* @param Length The length of the grid
* @param Height The height of the grid
*/
abstract class abstractGrid(var Length:Int, var Height:Int)
abstract class abstractGrid
{
/** Lenght of the grid */
var Length:Int = 20
/** Height of the grid */
var Height:Int = 9
/** List of all the entities on the grid */
var contents:List[Entity] = List()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment