赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 11219 |
最后登录 | 2012-8-9 |
在线时间 | 698 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 145
- 在线时间
- 698 小时
- 注册时间
- 2009-11-15
- 帖子
- 538
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 2719358 于 2009-12-11 18:16 编辑
大家帮我把这个小地图改的大一些,大约就像空轨那么大,另外要可以用一个开关来控制小地图是否出现- #==============================================================================
- class Midmap
- #==============================================================================
-
- #显示坐标
- MX = 470 #显示在地图X坐标
- MY = 10 #显示在地图Y坐标
-
- #显示窗口的大小
- GX = 32 #窗口中最多显示GX格
- GY = 24 #窗口中最多显示GY格
-
- #缩略点的大小
- DX = 5 #每格大小
-
- #原点
- OO = 1 #0左上(小地图对齐在视区的左上) 1右上
-
- #缩略图的颜色(分别是<红,黄,蓝,透明度>),不需要某种把透明度调0即可
- COLOR_A = Color.new(0,0,0,128) #底色
- COLOR_B = Color.new(0,128,255,192) #可通行色
- COLOR_C = Color.new(255,192,255,192) #描边色
-
- #事件点的颜色,更多请在95行照着插入
- #默认隐藏事件:1.含有"EV"的事件名和没有行走图 2.含有"EV"的事件名和没有执行内容
- EVENT_P = Color.new(255,128,128) #主角颜色
- EVENT_Z = Color.new(255,255,0) #不含"EV"的其他颜色
- EVENT_A = ["Enemy",Color.new(255,0,0)] #事件名"Enemy", 颜色
- EVENT_B = ["Trans",Color.new(128,255,128,128)] #事件名"Trans", 颜色
- EVENT_C = ["自定C",Color.new(0,0,0)] #自定义事件名 , 颜色
-
- #==============================================================================
- def initialize
- @pic = []
- star
- end
- def star
- width = $game_map.width
- height = $game_map.height
- @viewport = Viewport.new(MX,MY,GX*DX+1,GY*DX+1)
- for i in 0..2
- @pic[i] = Sprite.new(@viewport)
- @pic[i].bitmap = Bitmap.new(width*DX+1,height*DX+1)
- @pic[i].x = (GX - width)*DX if OO == 1
- @pic[i].z = 50
- end
- @pic[0].bitmap.fill_rect(0,0,width*DX+1,height*DX+1, COLOR_A)
- @pic[0].z -= 1
- @pic[2].z += 1
- @map = $game_map
- for x in 0...width
- for y in 0...height
- next unless @map.pass?(x,y,0)
- @pic[1].bitmap.fill_rect(x*DX+1,y*DX+1,DX-1,DX-1, COLOR_B)
- if @map.pass?(x,y,2) and @map.pass?(x,y+1,8)
- @pic[1].bitmap.fill_rect(x*DX+1,y*DX+DX,DX-1,1, COLOR_B)
- else
- @pic[1].bitmap.fill_rect(x*DX,y*DX+DX,DX+1,1, COLOR_C)
- end
- if @map.pass?(x,y,6) and @map.pass?(x+1,y,4)
- @pic[1].bitmap.fill_rect(x*DX+DX,y*DX+1,1,DX-1, COLOR_B)
- else
- @pic[1].bitmap.fill_rect(x*DX+DX,y*DX,1,DX+1, COLOR_C)
- end
- unless @map.pass?(x,y-1,0)
- @pic[1].bitmap.fill_rect(x*DX,y*DX,DX+1,1, COLOR_C)
- end
- unless @map.pass?(x-1,y,0)
- @pic[1].bitmap.fill_rect(x*DX,y*DX,1,DX+1, COLOR_C)
- end
- next unless @map.pass?(x,y,6)
- next unless @map.pass?(x,y,2)
- next unless @map.pass?(x+1,y,4)
- next unless @map.pass?(x+1,y,2)
- next unless @map.pass?(x,y+1,8)
- next unless @map.pass?(x,y+1,6)
- next unless @map.pass?(x+1,y+1,8)
- next unless @map.pass?(x+1,y+1,4)
- @pic[1].bitmap.fill_rect(x*DX+DX,y*DX+DX,1,1, COLOR_B)
- end
- end
- update
- end
- def update
- @pic[2].bitmap.clear
- for i in @map.events.keys
- next if @map.events[i].list.size <= 1 and
- /\E\V/ === @map.events[i].event.name
- next if @map.events[i].character_name == "" and
- /\E\V/ === @map.events[i].event.name
- color = EVENT_Z
- color = EVENT_A[1] if @map.events[i].event.name == EVENT_A[0]
- color = EVENT_B[1] if @map.events[i].event.name == EVENT_B[0]
- color = EVENT_C[1] if @map.events[i].event.name == EVENT_C[0]
- x = @map.events[i].x
- y = @map.events[i].y
- @pic[2].bitmap.fill_rect(x*DX+1,y*DX+1,DX-1,DX-1, color)
- end
- x = $game_player.x
- y = $game_player.y
- @pic[2].bitmap.fill_rect(x*DX+1,y*DX+1,DX-1,DX-1, EVENT_P)
- if @map.width > GX
- x = GX/2 if x < GX/2
- x = @map.width - GX/2 if @map.width - x < GX/2
- @pic[1].x = (GX/2 - x)*DX
- @pic[2].x = (GX/2 - x)*DX
- end
- if @map.height > GY
- y = GY/2 if y < GY/2
- y = @map.height - GY/2 if @map.height - y < GY/2
- @pic[1].y = (GY/2 - y)*DX
- @pic[2].y = (GY/2 - y)*DX
- end
- end
- end
- #==============================================================================
- # ● 默认脚本的更改
- #==============================================================================
- class Game_Map
- def pass?(x, y, d)
- for i in [2, 1, 0]
- tile_id = data[x, y, i]
- return false if tile_id == nil
- return false if @passages[tile_id] & ((1 << (d / 2 - 1)) & 0x0f) != 0
- return false if @passages[tile_id] & 0x0f == 0x0f
- return true if @priorities[tile_id] == 0
- end
- end
- end
- class Game_Event < Game_Character
- attr_reader :event
- end
- #添加显示与刷新
- class Scene_Map
- def main
- @spriteset = Spriteset_Map.new
- @message_window = Window_Message.new
- @midmap = Midmap.new #★
- Graphics.transition
- loop do
- Graphics.update
- Input.update
- update
- if $scene != self
- break
- end
- end
- Graphics.freeze
- @spriteset.dispose
- @message_window.dispose
- if $scene.is_a?(Scene_Title)
- Graphics.transition
- Graphics.freeze
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- 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
- @spriteset.update
- @message_window.update
- @midmap.update #★
- if $game_temp.gameover
- $scene = Scene_Gameover.new
- return
- end
- if $game_temp.to_title
- $scene = Scene_Title.new
- return
- end
- if $game_temp.transition_processing
- $game_temp.transition_processing = false
- if $game_temp.transition_name == ""
- Graphics.transition(20)
- else
- Graphics.transition(40, "Graphics/Transitions/" +
- $game_temp.transition_name)
- end
- end
- if $game_temp.message_window_showing
- return
- end
- if $game_player.encounter_count == 0 and $game_map.encounter_list != []
- unless $game_system.map_interpreter.running? or
- $game_system.encounter_disabled
- n = rand($game_map.encounter_list.size)
- troop_id = $game_map.encounter_list[n]
- if $data_troops[troop_id] != nil
- $game_temp.battle_calling = true
- $game_temp.battle_troop_id = troop_id
- $game_temp.battle_can_escape = true
- $game_temp.battle_can_lose = false
- $game_temp.battle_proc = nil
- end
- end
- end
- if Input.trigger?(Input::B)
- unless $game_system.map_interpreter.running? or
- $game_system.menu_disabled
- $game_temp.menu_calling = true
- $game_temp.menu_beep = true
- end
- end
- if $DEBUG and Input.press?(Input::F9)
- $game_temp.debug_calling = true
- end
- unless $game_player.moving?
- if $game_temp.battle_calling
- call_battle
- elsif $game_temp.shop_calling
- call_shop
- elsif $game_temp.name_calling
- call_name
- elsif $game_temp.menu_calling
- call_menu
- elsif $game_temp.save_calling
- call_save
- elsif $game_temp.debug_calling
- call_debug
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 主角的场所移动
- #--------------------------------------------------------------------------
- def transfer_player
- $game_temp.player_transferring = false
- if $game_map.map_id != $game_temp.player_new_map_id
- $game_map.setup($game_temp.player_new_map_id)
- end
- $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
- case $game_temp.player_new_direction
- when 2
- $game_player.turn_down
- when 4
- $game_player.turn_left
- when 6
- $game_player.turn_right
- when 8
- $game_player.turn_up
- end
- $game_player.straighten
- $game_map.update
- @spriteset.dispose
- @spriteset = Spriteset_Map.new
- @midmap.star #★
- if $game_temp.transition_processing
- $game_temp.transition_processing = false
- Graphics.transition(20)
- end
- $game_map.autoplay
- Graphics.frame_reset
- Input.update
- end
- end
复制代码 |
|