Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Alg. Frage Browsergame Programmierung
#2
Schreib dir ne Builds Klasse und mach dann zB:
PHP Code:
<?php class Builds { public $Builds; public function add_build($Name, $German) { $this->aktu_building = $Name; $this->Builds[$this->aktu_building] = array($Name, $German); } public function set_wood($Price, $Raise) { $this->Builds[$this->aktu_building]['wood'] = array($Price, $Raise); } } // USW.

Dann kannst du mittels $cl_builds->add_building ein Gebäude hinzufügen und mit set_wood den Holzpreis festlegen.
Brauchst halt für alle Ress ne Funktion.
Habs auch so ähnlich gemacht.

MfG Manuel
Reply


Messages In This Thread
RE: Alg. Frage Browsergame Programmierung - by SlimShady95 - 26.02.2010, 17:57



Users browsing this thread: 1 Guest(s)