Oniromancie: Scripts - Tic Tac Toe [VX]


Comment ça marche?

Acsiosa
Par ThrillerProd

Aëdemphia
Par Sylvanor

Chemin de Croix
Par Mr Bambou

Darkange
Par Scythe Darklight

Evil Myst
Par oxion_garden

Geex Maker
Par roys

La Légende d'Ibabou
Par Zaitan

Les Ombres d'Ymirs
Par Lakitorai

Lije
Par Gaetz

Omega Cerberus
Par Sill Valt

Oyönna
Par Tata Monos

Sarcia
Par Kaëlar

News: OFF chez Indiegames.com / Scripts: Niveau pour équiper une arme / Scripts: Anti-"No such file" [VX Ace] / Scripts: Scroll Pictures / News: Legalize our games ! /

Chat ( connectés)

Bienvenue
visiteur !







Statistiques

Liste des
membres


Contact

31 connectés actuellement

4596864 visiteurs
depuis l'ouverture

10 visiteurs
aujourd'hui

Groupe Facebook

Barre de séparation

Partenaires




TOP GAMEMAKING


Les 5 plus
visités

Guelnika - E Magination

ImagieNation

Level Up!

Alex d'Or

RPG Maker Powa

Au hasard

RPG Nation

Make-rpg

Galfart Studio

Les deux derniers

FreankExpo

Le Palais du Making

Nos autres partenaires

Devenir
partenaire


Barre de séparation

Un site du réseau
War Paradise

Annuaires référenceurs




Tic Tac Toe [VX]
Script pour RPG Maker VX
Ecrit par Master of Dragons

Nom du script : Tic_Tac_Toe_Maxhack
Scripteur : Maxhack

Importation dans le jeu :
Comme indiqué dans le script :
Insérez : "$scene = Tictactoe.new" sans les guillemets en script dans un évenement.
Script :



Portion de code : Tout sélectionner

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
 
 
######################################
# Jeu Tic-tac-toe fait par Maxhack pour RMVX - 11 Juillet 2008
# Insérez mon pseudo dans les crédits de votre projet si vous l'utilisez.
# Merci !
 
# Version : 1.0
 
# Pour lancer le mini-jeu insérer ce script dans un évenement :
# "$scene = Tictactoe.new" sans les guillemets
 
#
######################################
 
class Tictactoe
 
  @@turn = "x"
  @@font_name = "Arial"
  @@font_size = 30
 
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
######################
  def main
  @turnWindow = Turn_Window.new(@@turn)
  @turnWindow.x = 378
  @turnWindow.y = 355
  setSquares
  setMenu
 
  Graphics.transition
  loop do
    Graphics.update
    Input.update
    update
    if $scene != self
    break
    end
  end
 
  Graphics.freeze
  @command_window.dispose
  @turnWindow.dispose
 
  for x in 0..8
    @sqr[x].dispose
  end
  end
######################
  def update
    @command_window.update
    @turnWindow.update(@@turn)
 
    for x in 0..8
    @sqr[x].update
    end
 
  if @command_window.active
      update_command
      return
  end
  end
 
######################
  def update_command
    if Input.trigger?(Input::B)
      $scene = Scene_Map.new
      return
    end
    if Input.trigger?(Input::C)
      case @command_window.index
      when 0..8
        doAction(@command_window.index)
      when 9
        $scene = Tictactoe.new
      when 10
        $scene = Scene_Map.new
      end
      return
    end
  end
######################
def setMenu
  s1 = "Haut gauche"
  s2 = "Haut milieu"
  s3 = "Haut droit"
  s4 = "Centre gauche"
  s5 = "Centre milieu"
  s6 = "Centre droit"
  s7 = "Bas gauche"
  s8 = "Bas milieu"
  s9 = "Bas droit"
  s10 = "Redémarrer"
  s11 = "Quitter"
  @command_window = Window_Command.new(175, [s1, s2, s3, s4, s5, s6,s7,s8,s9,s10,s11])
  @command_window.index = @menu_index
  @command_window.x = 368
end
######################
def setSquares
  @sqr = []
  for x in 0..2
    @sqr[x] = Square.new(@@font_name,@@font_size)
    @sqr[x].x = (x+0.3)*100
    @sqr[x].y = 50
  end
 
  for x in 3..5
    @sqr[x] = Square.new(@@font_name,@@font_size)
    @sqr[x].x = (x-2.7)*100
    @sqr[x].y = 150
  end
 
  for x in 6..8
    @sqr[x] = Square.new(@@font_name,@@font_size)
    @sqr[x].x = (x-5.7)*100
    @sqr[x].y = 250
  end
 
end
######################
def doAction(squareId)
  if (@sqr[squareId].getOwner == "none")
    @sqr[squareId].setOwner(@@turn)
    verifyScore
  else
  end
end
######################
def verifyScore
  gameIsFinish = false
  #check all --
  for x in 0..2
    if (@sqr[x*3].getOwner == @@turn && @sqr[x*3+1].getOwner == @@turn && @sqr[x*3+2].getOwner == @@turn)
      print "Les "+@@turn+" a gagné !"
      gameIsFinish = true
    end
  end
 
  #check all |
  for x in 0..2
    if (@sqr[x].getOwner == @@turn && @sqr[x+3].getOwner == @@turn && @sqr[x+6].getOwner == @@turn)
      print "Les "+@@turn+" a gagné !"
      gameIsFinish = true
    end
  end
 
  #check \
  if (@sqr[0].getOwner == @@turn && @sqr[4].getOwner == @@turn && @sqr[8].getOwner == @@turn)    
    print "Les "+@@turn+" a gagné !"
    gameIsFinish = true
  end
 
  #check /
  if (@sqr[2].getOwner == @@turn && @sqr[4].getOwner == @@turn && @sqr[6].getOwner == @@turn)
    print "Les "+@@turn+" a gagné !"
    gameIsFinish = true
  end
 
  if noMoreSpace && !gameIsFinish
    print "Match nul!"
    $scene = Scene_Restart.new
  end
 
  if gameIsFinish
    $scene = Scene_Restart.new
  elsif (@@turn == "x")
    @@turn = "o"
  else @@turn = "x"
  end
end
######################
def noMoreSpace
  for x in 0..8
    if (@sqr[x].getOwner == "none")
      return false
    end
  end
  return true
end
######################
end
 
#----------------------------------------------------------------------
#Squares
#----------------------------------------------------------------------
class Square < Window_Base
 
  def initialize(fontName,fontSize)
    @owner = "none"
  
    super(0, 0, 100,100)
    self.contents = Bitmap.new(width-32, height-32)
    self.contents.font.name = fontName 
    self.contents.font.size = fontSize
    refresh
  end
 
  def refresh
    self.contents.clear
    if (@owner == "x")
      self.contents.font.color = text_color(2)
      self.contents.draw_text(22, 15, 100, 32, "X")
    elsif (@owner == "o")
      self.contents.font.color = text_color(1)
      self.contents.draw_text(22, 15, 100, 32, "O")
    end
  end
 
  def update
    refresh
  end
#############
  def setOwner(newOwner)
    @owner = newOwner
  end
#############
  def getOwner
    return @owner
  end
#############
end
 
#----------------------------------------------------------------------
#Turn Window
#----------------------------------------------------------------------
class Turn_Window < Window_Base
 
  def initialize(turn)
    super(0, 0, 165,60)
    self.contents = Bitmap.new(width-32, height-32)
    self.contents.font.name = "Arial" 
    self.contents.font.size = 30
    refresh(turn)
  end
 
  def refresh(turn)
    self.contents.clear
    if (turn == "x")
      self.contents.font.color = text_color(2)
      self.contents.draw_text(0,0,100,32,"Tour de : X")
    elsif
      self.contents.font.color = text_color(1)
      self.contents.draw_text(0,0,100,32,"Tour de : O")
    end
  end
 
  def update(turn)
    refresh(turn)
  end
end
#----------------------------------------------------------------------
#scene restart
#----------------------------------------------------------------------
class Scene_Restart
 
  @@font_name = "Arial"
  @@font_size = 40
 
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
######################
  def main
    setMenu
  
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
 
    Graphics.freeze
    @command_window.dispose
  end
######################
  def update
    @command_window.update
 
    if @command_window.active
        update_command
        return
    end
  end
######################
  def update_command
    if Input.trigger?(Input::C)
      case @command_window.index
      when 0
        $scene = Tictactoe.new
      when 1
        $scene = Scene_Map.new
      end
      return
    end
  end
###################### 
  def setMenu
    s1 = "Nouvelle partie"
    s2 = "Quitter"
    @command_window = Window_Command.new(180, [s1, s2])
    @command_window.index = @menu_index
    @command_window.x = 360
    @command_window.y = 330
  end
end 
 



Screen :

image


crackerwood - posté le 08/01/2012 à 11:28:44. (133 messages postés)

Bonjour. C'est un bon script qui fonctionne bien pour deux joueurs. Mais comme on général on joue à un RPG seul n'y a t-il pas moyen d'ajouter une IA ?

http://www.rpg-maker.fr/tutoriels-394-cms-en-event.html----http://www.rpg-maker.fr/tutoriels-363-systeme-de-phs.html----http://www.rpg-maker.fr/tutoriels-399-blackjack.html----http://www.rpg-maker.fr/tutoriels-470-phs-event-rmvx.html


quent1500 - posté le 08/01/2012 à 13:55:37. (19 messages postés)

C'est pour faire un tic tac teo son coder se script ???

Mon jeu La nouvelle dynastie et a 5% d'avancement je début en modification de scripts


Master of Dragons - posté le 09/01/2012 à 02:27:41. (98 messages postés)

Tous les dragons sont à moi !

Pour l'IA je ne sais pas.
Euh quent1500 je n'ai pas bien compris ta question ^^'

"Royal d'abord, Premier toujours", 1er Régiment de Dragons (Historique, c'est vrai, VÉRIFIEZ !)


Enzuki - posté le 19/05/2012 à 18:44:21. (23 messages postés)

Bah en fait il pense que tout le monde ne joue pas au morpion avec rpgm^^ enfin moi je résonne comme ça sinon c'est pas mal dans l'idée de l'originalité et des amateurs de morpions^^

Suite à de nombreux abus, le post en invités a été désactivé. Veuillez vous inscrire si vous souhaitez participer à la conversation.

Haut de page

Merci de ne pas reproduire le contenu de ce site sans autorisation.
Contacter l'équipe

Plan du site:

Activité: Accueil | News | Forum | Flash-news | Chat | Commentaires | Galerie | Screen de la semaine | Sorties | Articles perso | Livre d'or | Recherche
Jeux: Index jeux séparés | Top Classiques | Top Originaux | Les autres | RPG Maker 95 | RPG Maker 2000 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | Autres | Jeux complets | Proposer
Rubriques: Le Wiki | Collection Oniro | Tutoriaux | Scripts | Guides | Gaming-Live | Tests | Previews | Making-of | Interviews | Articles perso | OST | L'Annuaire | Divers | Palmarès
Hébergés: Acsiosa | Aëdemphia | Chemin de Croix | Darkange | Evil Myst | Geex Maker | La Légende d'Ibabou | Les Ombres d'Ymirs | Lije | Omega Cerberus | Oyönna | Sarcia
Ressources: Jeux | Programmes | Packs de ressources | Midis | Eléments séparés | Sprites
RPG Maker 2000/2003: Chipsets | Charsets | Panoramas | Backdrops | Facesets | Battle anims | Battle charsets | Monstres | Systems | Templates
RPG Maker XP: Tilesets | Autotiles | Characters | Battlers | Window skins | Icônes | Transitions | Fogs | Templates
RPG Maker VX: Tilesets | Charsets | Facesets | Systèmes