diff --git a/README.md b/README.md deleted file mode 100644 index e01f1e6..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# rc2019su_g2 -RubyCamp2019Summer Group2 diff --git a/director.rb b/director.rb new file mode 100644 index 0000000..5ec7000 --- /dev/null +++ b/director.rb @@ -0,0 +1,41 @@ +require_relative 'teki' +require_relative 'player' + +class Director + def initialize + @bg_img = Image.load("image/backscreen_loop.png") + @suzuki = Shittin.new(300, 300, "image/suzuki.png",1) + @morogeebi = Shittin.new(1000, 300, "image/ebi.png",0) +@unagi = Shittin.new(300, 400, "image/unagi.png",0) +@amasazi = Shittin.new(500, 300, "image/wakasagi.png",0) + @shizimi = Shittin.new(300, 500, "image/shizimi.png",0) + @koi = Shittin.new(100, 300, "image/koi.png",0) +@sirauo = Shittin.new(300, 100, "image/shirauo.png",0) + @teki=Teki.new(150,150,"image/kuribo1.png") + @player_image = Image.load('ghost.png') + @player = Player.new(100, 100, @player_image) + end + + def play + Window.draw(0, 0, @bg_img) + Window.draw(800, 0, @bg_img) +Window.draw(0, 563, @bg_img) +Window.draw(800, 600, @bg_img) + @suzuki.draw + @morogeebi.draw + @unagi.draw + @amasazi.draw + @shizimi.draw + @koi.draw + @sirauo.draw + @teki.draw + @teki.move + @player.down if Input.key_down?(K_DOWN) + @player.up if Input.key_down?(K_UP) + @player.right if Input.key_down?(K_RIGHT) + @player.left if Input.key_down?(K_LEFT) + @player.draw + + + end +end \ No newline at end of file diff --git a/ghost.png b/ghost.png new file mode 100644 index 0000000..28edb3d Binary files /dev/null and b/ghost.png differ diff --git a/image/Mario1.png b/image/Mario1.png new file mode 100644 index 0000000..64d065c Binary files /dev/null and b/image/Mario1.png differ diff --git a/image/background.png b/image/background.png new file mode 100644 index 0000000..1768dfc Binary files /dev/null and b/image/background.png differ diff --git a/image/backscreen_loop.png b/image/backscreen_loop.png new file mode 100644 index 0000000..f4e67e0 Binary files /dev/null and b/image/backscreen_loop.png differ diff --git a/image/ebi.png b/image/ebi.png new file mode 100644 index 0000000..e5f144e Binary files /dev/null and b/image/ebi.png differ diff --git a/image/koi.png b/image/koi.png new file mode 100644 index 0000000..9582aa9 Binary files /dev/null and b/image/koi.png differ diff --git a/image/kuribo1.png b/image/kuribo1.png new file mode 100644 index 0000000..d69ebfe Binary files /dev/null and b/image/kuribo1.png differ diff --git a/image/player.jpg b/image/player.jpg new file mode 100644 index 0000000..7255b6e Binary files /dev/null and b/image/player.jpg differ diff --git a/image/player_new.png b/image/player_new.png new file mode 100644 index 0000000..0977ae1 Binary files /dev/null and b/image/player_new.png differ diff --git a/image/shirauo.png b/image/shirauo.png new file mode 100644 index 0000000..c4e2a7d Binary files /dev/null and b/image/shirauo.png differ diff --git a/image/shizimi.png b/image/shizimi.png new file mode 100644 index 0000000..acc13ea Binary files /dev/null and b/image/shizimi.png differ diff --git a/image/suzuki.png b/image/suzuki.png new file mode 100644 index 0000000..0259a50 Binary files /dev/null and b/image/suzuki.png differ diff --git a/image/unagi.png b/image/unagi.png new file mode 100644 index 0000000..0fedf82 Binary files /dev/null and b/image/unagi.png differ diff --git a/image/wakasagi.png b/image/wakasagi.png new file mode 100644 index 0000000..5b22580 Binary files /dev/null and b/image/wakasagi.png differ diff --git a/main.rb b/main.rb new file mode 100644 index 0000000..33a5876 --- /dev/null +++ b/main.rb @@ -0,0 +1,17 @@ +require 'dxruby' + +require_relative 'director' +require_relative 'shittin' +#require_relative 'player' + + +Window.caption = "RubyCamp Example" +Window.width = 800 +Window.height = 600 + +director = Director.new + + +Window.loop do + director.play +end diff --git a/player.rb b/player.rb new file mode 100644 index 0000000..5c51e5c --- /dev/null +++ b/player.rb @@ -0,0 +1,15 @@ +class Player < Sprite + + def up + self.y -= 5 + end + def down + self.y += 5 + end + def right + self.x += 5 + end + def left + self.x -= 5 + end +end diff --git a/shittin.rb b/shittin.rb new file mode 100644 index 0000000..d327eb0 --- /dev/null +++ b/shittin.rb @@ -0,0 +1,16 @@ +class Shittin + def initialize(x, y, image_file,z) + @x, @y,@z = x, y,z + @image = Image.load(image_file) + @image.set_color_key([0, 0, 0]) + @dx = 1 + + end + + + def draw + Window.draw(@x, @y, @image,@z) + + + end +end diff --git a/teki.rb b/teki.rb new file mode 100644 index 0000000..3a32863 --- /dev/null +++ b/teki.rb @@ -0,0 +1,17 @@ +class Teki + def initialize(x, y, image_file) + @x, @y = x, y + @image = Image.load(image_file) + @image.set_color_key([0, 0, 0]) + @dx = 1 + end + def draw + Window.draw(@x, @y, @image) + end + + def move + @x+=rand(4)-2 + @y+=rand(4)-2 +end +end + \ No newline at end of file