if condition do
# execute here when condition is true
end
while condtion do
# execute here again and again while condition is true
end
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
current directory: C:/Ruby23/lib/ruby/gems/2.3.0/gems/debase-0.2.1/ext | |
C:/Ruby23/bin/ruby.exe -r ./siteconf20170317-11968-1h343qx.rb extconf.rb | |
checking for vm_core.h... *** extconf.rb failed *** | |
Could not create Makefile due to some reason, probably lack of necessary | |
libraries and/or headers. Check the mkmf.log file for more details. You may | |
need configuration options. | |
Provided configuration options: | |
--with-opt-dir | |
--without-opt-dir |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dim say As String, i as Integer | |
say = "I love Ruby" | |
For i = 1 To 5 Step 1 | |
MsgBox say | |
Next i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
require_relative './command_block' | |
require_relative './command_error' | |
require_relative './command_parts' | |
module Command | |
def self.included(mod) | |
mod.instance_eval do | |
include CommandSetter |
この記事はDXRuby Advent Calendarの16日目の記事です。昨日はmirichiさんのDXRubyの怪しげで不自然な挙動について語るでした。DirectXをCで直接叩いているそうで、かなり大変そうですね。しかし全て把握しているのもまた、凄いと思います。
どうも、GameKazuです。DXRubyという使いやすいライブラリを使って、RPGという最も複雑なゲームの1つを作ろうとしている学生です。プログラミング歴は3年と少し、RubyとDXRubyは2年と少しなので、今回の参加者の中でも短い方だと思います。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mapは、TileSetを一つ持つ。 | |
自身の持つ二次元配列とTileSetから受け取る画像配列で描画する。 | |
TileSetは、Tileをまとめる。 | |
分割前の画像・分割方法を記憶し、Tileを生成して保持。 | |
Tileから画像を受け取り画像配列を作る。 | |
Tileの一部だけ画像を変更するとそれを記憶しておく。 | |
Tileはそれぞれのtype毎にサブクラスを定義し、生成時に受け取った画像などの情報を適切に処理する。 | |
オートタイルで実際に表示される画像(複数)を保持する。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'dxruby' | |
piano = [0.419414141440249, | |
0.166971777138902, | |
0.235853904101082, | |
0.0470590406691173, | |
0.0373803247025181, | |
0.00373803247025181, | |
0.0166971777138902, | |
0.0419414141440249, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: ASCII | |
require 'dxruby' | |
require 'zlib' | |
module DXRuby | |
class Image | |
def marshal_dump | |
image_data = [] | |
for y in 0...height |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding: UTF-8 | |
require 'dxruby' | |
############################################################################### | |
#How you use this is almost equal to AnimeSprite class. # | |
#(http://dxruby.sourceforge.jp/cgi-bin/hiki.cgi?AnimeSprite%A5%AF%A5%E9%A5%B9)# | |
#You only have to remenber to call not 'update' method, # | |
#but 'update_animation' method. # | |
# # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding: UTF-8 | |
require 'dxruby' | |
module DXRuby | |
def self.image?(v) | |
Image === v || RenderTarget === v | |
end | |
module Animation |
NewerOlder