赞 | 0 |
VIP | 12 |
好人卡 | 42 |
积分 | 7 |
经验 | 44348 |
最后登录 | 2024-4-1 |
在线时间 | 791 小时 |
- 梦石
- 0
- 星屑
- 690
- 在线时间
- 791 小时
- 注册时间
- 2011-10-20
- 帖子
- 2394
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 end55rpg 于 2014-5-12 16:01 编辑
哇哈哈哈哈哈哈哈哈哈啊啊啊啊啊我的包啊- plus_x = 0 #((@anim / 4) % (@autotiles[id].width / 96)) * 96
- for corner in 0..3
- h = 4 * (pos % 48) + corner # Used to access INDEX
- # src_rect = 16x16 Rect on the autotile for source bitmap
- src_rect = Rect.new((INDEX[h]%6)*16+plus_x, (INDEX[h]/6)*16, 16, 16)
- # Transfer source bitmap on the autotile to the current 16x16 tile
- @bitmaps[@priorities[pos]].blt(x*32+X[corner]*16, y*32+Y[corner]*16,
- @autotiles[id], src_rect)
- end
- end
- end
- end
- end
- #===============================================================================
- class Game_Map
- attr_accessor :pitch
- attr_accessor :plus_y
- #-----------------------------------------------------------------------------
- alias setup_or :setup
- def setup(map_id)
- setup_or(map_id)
- @pitch = $data_map[$game_map.map_id].pitch
- @plus_y = 0
- end
- #-----------------------------------------------------------------------------
- def name
- return $data_map[@map_id].name
- end
- end
- #===============================================================================
- class Sprite_Character < RPG::Sprite
- attr_accessor :character
- #-----------------------------------------------------------------------------
- def initialize(character = nil)
- super()
- @character = character
- update
- end
- #-----------------------------------------------------------------------------
- alias update_or :update
- def update
- update_or
- # Update pitch value, and update zoom values to match
- @pitch = $data_map[$game_map.map_id].pitch.to_f
- self.zoom_x =
- self.zoom_y = ((@character.screen_y - 16) - ($height / 2)) *
- (@pitch / ($height * 25)) + 1
- # Set sprite coordinates. X value is multiplied by zoom value from the center
- self.x = ($width / 2) + ((@character.screen_x - ($width / 2)) * self.zoom_x)
- self.y = @character.screen_y
- # Add Y value for zoom compensation while in curve mode
- if $curve and @pitch != 0
- self.y += (8 * (1 - self.zoom_y) * ((1 - self.zoom_y) /
- (2 * ((@pitch / 100) / ($height / 16.0))) + 0.5))
- end
- # Add plus_y value; used in airship script
- self.y += $game_map.plus_y unless @character.is_a?(Game_Player)
- self.z = @character.screen_z(@ch) - (self.zoom_y < 0.5 ? 1000 : 0)
- if $data_map[$game_map.map_id].overworld? and
- @character.is_a?(Game_Player) # Multiply zoom by Overworld factor if
- self.zoom_x *= $ov_zoom # the map is marked with [OV] and event
- self.zoom_y *= $ov_zoom # is a Game_Player
- end
- end
- end
- #===============================================================================
- class Spriteset_Map
- def initialize
- # Make viewports
- @viewport1 = Viewport.new(0, 0, 640, 480)
- @viewport2 = Viewport.new(0, 0, 640, 480)
- @viewport3 = Viewport.new(0, 0, 640, 480)
- @viewport2.z = 2000
- @viewport3.z = 5000
- # Make tilemap
- @tilemap = Draw_Tilemap.new
- # Make panorama plane
- @panorama = Plane.new
- @panorama.z = -2000
- # Make fog plane
- [url=home.php?mod=space&uid=14217]@fog[/url] = Plane.new
- @fog.z = 3000
- # Make character sprites
- @character_sprites = []
- for i in $game_map.events.keys.sort
- sprite = Sprite_Character.new($game_map.events[i])
- @character_sprites.push(sprite)
- end
- @character_sprites.push(Sprite_Character.new($game_player))
- # Make weather
- @weather = RPG::Weather.new(@viewport1)
- # Make picture sprites
- @picture_sprites = []
- for i in 1..50
- @picture_sprites.push(Sprite_Picture.new(@viewport2,
- $game_screen.pictures[i]))
- end
- # Make timer sprite
- @timer_sprite = Sprite_Timer.new
- # Frame update
- update
- end
- #-----------------------------------------------------------------------------
- def dispose
- # Dispose of tilemap
- @tilemap.dispose
- # Dispose of panorama plane
- @panorama.dispose
- # Dispose of fog plane
- @fog.dispose
- # Dispose of character sprites
- for sprite in @character_sprites
- sprite.dispose
- end
- # Dispose of weather
- @weather.dispose
- # Dispose of picture sprites
- for sprite in @picture_sprites
- sprite.dispose
- end
- # Dispose of timer sprite
- @timer_sprite.dispose
- # Dispose of viewports
- @viewport1.dispose
- @viewport2.dispose
- @viewport3.dispose
- end
- end
复制代码 |
评分
-
查看全部评分
|