Code: |
Thread.new { sleep 0.5; for i in 0..10;p i;end };Thread.new { sleep 0.5; for i in 10...20;p i;end }; sleep 2 |
Code: |
10 0 11 1 12 2 13 3 14 4 15 5 16 6 17 7 18 8 19 9 10 |
Code: |
class Image_Youri def update $mouse.update $interface.update if $scene.class != Pkmn_Scene_Title $og.update if @message[4] and !@working for i in 0..$config.msg_sp update_message end end for i in @images i[1].update_sprite end end end |
Code: |
def update # ループ loop do # マップ、インタプリタ、プレイヤーの順に更新 # (この更新順序は、イベントを実行する条件が満たされているときに # プレイヤーに一瞬移動する機会を与えないなどの理由で重要) $game_map.update $game_system.map_interpreter.update $game_player.update # システム (タイマー)、画面を更新 $game_system.update $game_screen.update # プレイヤーの場所移動中でなければループを中断 unless $game_temp.player_transferring break end # 場所移動を実行 transfer_player # トランジション処理中の場合、ループを中断 if $game_temp.transition_processing break end end $yi.update #Utilisation de la méthode qui va mettre presque tout a jour ^_^ # スプライトセットを更新 @spriteset.update #Elle est même utilisé avant ma mise a jour de la map :B # メッセージウィンドウを更新 @message_window.update #[ etc ...] end |
Code: |
def update(var=nil) case var when 0 print "salut" when 1 print "oh !" when 2 #commande else return end #code end |
Code: |
def increase_steps @steps = [@steps + 1, 9999999].min # Repel if @repel_count > 0 @repel_count -= 1 end # Reduit le nombre de pas pour chaque oeuf for pokemon in @actors if pokemon.egg pokemon.decrease_step end end # Inspecte la pension Daycare.sequence end |
Code: |
# Round: Attaques def phase3 if not($combat_contre_pokemon_fuyard) # print("Pokemon non fuyard") if @strike_first # print("Le héros attaque le premier") if @actor_action == 1 and not(@actor.dead?) attack_action(@actor, @actor_skill, @enemy) end elsif not(@enemy_caught) and @enemy_action == 1 and not(@enemy.dead?) #print("Le pokemon sauvage attaque le premier") attack_action(@enemy, @enemy_skill, @actor) end faint_check if @actor.dead? or @enemy.dead? or $battle_var.battle_end? return end if not(@strike_first) if @actor_action == 1 and not(@actor.dead?) #print("Le héros attaque en second") attack_action(@actor, @actor_skill, @enemy) end elsif not(@enemy_caught) and @enemy_action == 1 and not(@enemy.dead?) # print("Le pokemon sauvage attaque en second") attack_action(@enemy, @enemy_skill, @actor) end faint_check if @actor.dead? or @enemy.dead? or $battle_var.battle_end? return end else # print("Pokemon fuyard") if @strike_first #Le pokemon du héros attaque avant que le pokemon sauvage s'enfuit #print("Le heros peut attaquer !") attack_action(@actor, @actor_skill,@enemy) else #Le pokemon sauvage s'enfuit avant de se faire attaquer #print("Le pokemon sauvage s'enfuit (V1)") run_enemy $combat_contre_pokemonn_fuyard = false end if @actor.dead? or @enemy.dead? or $battle_var.battle_end? return end # print("Le pokemon sauvage s'enfuit (V2)") run_enemy # Le pokemon s'enuit avant que le heros ne puisse $combat_contre_pokemon_fuyard = false # attaquer => pas besoin de condition en plus end end |