Project1
标题:
如何在地图中战斗?
[打印本页]
作者:
gagbgc
时间:
2012-4-2 14:58
标题:
如何在地图中战斗?
不是进入战斗界面战斗
作者:
殇殃
时间:
2012-4-3 11:42
本提问区的置顶版务贴有个图书馆,里面有“用地图做战斗背景”的脚本。
作者:
maliut
时间:
2012-4-3 18:47
http://rpg.blue/xas/
作者:
忧雪の伤
时间:
2012-4-3 19:02
本帖最后由 忧雪の伤 于 2012-4-3 19:02 编辑
请善用搜查:
ARPG
。
作者:
殇殃
时间:
2012-4-4 10:49
现在的年轻人真的太懒了{:2_270:}
#如果要开启地图战斗背景模式,
#请在地图设置中选择指定战斗背景图像
#然后把两个背景都选择为无即可。
def mapbatbac
return false if $BTEST
return false if $game_map.battleback1_name!=""
return false if $game_map.battleback2_name!=""
return true
end
class Spriteset_Battle
def initialize
create_viewports
if mapbatbac
create_tilemap
create_parallax
create_characters
create_shadow
create_weather
end
create_battleback1
create_battleback2
create_enemies
create_actors
create_pictures
create_timer
update
end
def dispose
if mapbatbac
dispose_tilemap
dispose_parallax
dispose_characters
dispose_shadow
dispose_weather
end
dispose_battleback1
dispose_battleback2
dispose_enemies
dispose_actors
dispose_pictures
dispose_timer
dispose_viewports
end
def update
if mapbatbac
update_tileset
update_tilemap
update_parallax
update_characters
update_shadow
update_weather
end
update_battleback1
update_battleback2
update_enemies
update_actors
update_pictures
update_timer
update_viewports
end
def create_characters
@character_sprites = []
$game_map.events.values.each do |event|
@character_sprites.push(Sprite_Character.new(@viewport1, event))
end
$game_map.vehicles.each do |vehicle|
@character_sprites.push(Sprite_Character.new(@viewport1, vehicle))
end
@map_id = $game_map.map_id
end
def update_characters
refresh_characters if @map_id != $game_map.map_id
@character_sprites.each {|sprite| sprite.update }
end
def dispose_characters
@character_sprites.each {|sprite| sprite.dispose }
end
def create_tilemap
@tilemap = Tilemap.new(@viewport1)
@tilemap.map_data = $game_map.data
load_tileset
end
def load_tileset
@tileset = $game_map.tileset
@tileset.tileset_names.each_with_index do |name, i|
@tilemap.bitmaps[i] = Cache.tileset(name)
end
@tilemap.flags = @tileset.flags
end
def create_parallax
@parallax = Plane.new(@viewport1)
@parallax.z = -100
end
def create_shadow
@shadow_sprite = Sprite.new(@viewport1)
@shadow_sprite.bitmap = Cache.system("Shadow")
@shadow_sprite.ox = @shadow_sprite.bitmap.width / 2
@shadow_sprite.oy = @shadow_sprite.bitmap.height
@shadow_sprite.z = 180
end
def create_weather
@weather = Spriteset_Weather.new(@viewport2)
end
def dispose_tilemap
@tilemap.dispose
end
def dispose_parallax
@parallax.bitmap.dispose if @parallax.bitmap
@parallax.dispose
end
def dispose_shadow
@shadow_sprite.dispose
end
def dispose_weather
@weather.dispose
end
def update_tileset
if @tileset != $game_map.tileset
load_tileset
refresh_characters
end
end
def update_tilemap
@tilemap.map_data = $game_map.data
@tilemap.ox = $game_map.display_x * 32
@tilemap.oy = $game_map.display_y * 32
@tilemap.update
end
def update_parallax
if @parallax_name != $game_map.parallax_name
@parallax_name = $game_map.parallax_name
@parallax.bitmap.dispose if @parallax.bitmap
@parallax.bitmap = Cache.parallax(@parallax_name)
Graphics.frame_reset
end
@parallax.ox = $game_map.parallax_ox(@parallax.bitmap)
@parallax.oy = $game_map.parallax_oy(@parallax.bitmap)
end
def update_shadow
airship = $game_map.airship
@shadow_sprite.x = airship.screen_x
@shadow_sprite.y = airship.screen_y + airship.altitude
@shadow_sprite.opacity = airship.altitude * 8
@shadow_sprite.update
end
def update_weather
@weather.type = $game_map.screen.weather_type
@weather.power = $game_map.screen.weather_power
@weather.ox = $game_map.display_x * 32
@weather.oy = $game_map.display_y * 32
@weather.update
end
end
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1