Night.png);">
Apprendre


Vous êtes
nouveau sur
Oniromancie?

Visite guidée
du site


Découvrir
RPG Maker

RM 95
RM 2000/2003
RM XP
RM VX/VX Ace
RM MV/MZ

Apprendre
RPG Maker

Tutoriels
Guides
Making-of

Dans le
Forum

Section Entraide

Sorties: Star Trek: Glorious Wolf - (...) / Sorties: Dread Mac Farlane - episode 3 / News: Plein d'images cools créées par (...) / Sorties: Star Trek: Glorious Wolf - (...) / Jeux: Final Fantasy 2.0 / Chat

Bienvenue
visiteur !




publicité RPG Maker!

Statistiques

Liste des
membres


Contact

Mentions légales

250 connectés actuellement

29185436 visiteurs
depuis l'ouverture

5701 visiteurs
aujourd'hui



Barre de séparation

Partenaires

Indiexpo

Akademiya RPG Maker

Blog Alioune Fall

Fairy Tail Constellations

Offgame

RPG Maker - La Communauté

Tashiroworld

Le Comptoir Du clickeur

Tous nos partenaires

Devenir
partenaire



Tic Tac Toe

Un mini jeu de Tic Tac Toe (morpion).

Script pour RPG Maker VX
Ecrit par Maxhack (site de l'auteur)
Publié par Master of Dragons (lui envoyer un message privé)
Signaler un script cassé

❤ 0

Scripteur : Inconnu, Maxhack (edit)
Logiciel : RPG Maker VX et VX Ace (probabilité forte)
Nombre de scripts : 1
Source : http://rpgmaker-xp-vx.e-monsite.com/pages/rpg-maker-vx/scripts/mini-je-de-morpion.html
Script original : https://www.rpg-maker.fr/index.php?page=scripts&id=23

Utilisation
Pour lancer une partie de morpion, insérez un événement en appel de script avec :

Portion de code : Tout sélectionner

1
$scene = Tictactoe.new



Conditions d'utilisation
Vous devez créditer Maxhack si vous utilisez ce 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
######################################
# 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
        $game_system.se_play($data_system.decision_se)
        $scene = Tictactoe.new
      when 1
        $game_system.se_play($data_system.cancel_se)
        $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




Mis à jour le 19 novembre 2020.






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

❤ 0

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 ?

CMS event--PHS--Blackjack--PHS event VX


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

❤ 0

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


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

❤ 0

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 (24 messages postés)

❤ 0

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 - Mentions légales

Plan du site

Communauté: Accueil | Forum | Chat | Commentaires | News | Flash-news | Screen de la semaine | Sorties | Tests | Gaming-Live | Interviews | Galerie | OST | Blogs | Recherche
Apprendre: Visite guidée | RPG Maker 95 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker MV | Tutoriels | Guides | Making-of
Télécharger: Programmes | Scripts/Plugins | Ressources graphiques / sonores | Packs de ressources | Midis | Eléments séparés | Sprites
Jeux: Au hasard | Notre sélection | Sélection des membres | Tous les jeux | Jeux complets | Le cimetière | RPG Maker 95 | RPG Maker 2000 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker VX Ace | RPG Maker MV | Autres | Proposer
Ressources RPG Maker 2000/2003: Chipsets | Charsets | Panoramas | Backdrops | Facesets | Battle anims | Battle charsets | Monstres | Systems | Templates
Ressources RPG Maker XP: Tilesets | Autotiles | Characters | Battlers | Window skins | Icônes | Transitions | Fogs | Templates
Ressources RPG Maker VX: Tilesets | Charsets | Facesets | Systèmes
Ressources RPG Maker MV: Tilesets | Characters | Faces | Systèmes | Title | Battlebacks | Animations | SV/Ennemis
Archives: Palmarès | L'Annuaire | Livre d'or | Le Wiki | Divers