Kingdom Ablaze
Sponsor
ZOMFG!!!!!!!!!!!!!!!!! thats freaking amazing!!!!!!!!!!!!! i have a nvida geforce 9500 GS so i dont know if that makes a diffrence, but no lagg and looks amazing!!!!!! let me be the first to say kick ass job man
class Scene_DriverChoice
def main
# Make system object and data (Can't make command windows with out 'em! :D)
$game_system = Game_System.new
$data_system = load_data("Data/System.rxdata")
# Make command window
s1 = "Software - IrrlichtEngine Driver"
s2 = "Hardware - Direct3D9"
s3 = "D3D8 DOES NOT WORK!"
s4 = "Hardware - OpenGL"
s5 = "Software - Burning's Video"
@command_window = Window_Command.new(300, [s1, s2, s3, s4, s5])
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 100
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of command window
@command_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update command window
@command_window.update
# If C button was pressed
if Input.trigger?(Input::C)
$scene = Scene_3DTest.new(@command_window.index)
end
end
end
class Scene_3DTest
def initialize(drivertype = 0) #the scene before this one let's you pick a driver
#this is just a simple int:
# 0 - Software
# 1 - Direct3D9
# 2 - Direct3D9
# 3 - OpenGL
# 4 - Burning's Video
DF_3DRMXPSDK::START3D_FUNC.call(drivertype) #start our 3D window
DF_GameWindow.set_dimensions(0,0,0,0) #move the 2D window out of the way
DF_3DRMXPSDK::CREATELEVEL_FUNC.call("20kdm2") #load our level
#note that passing that string
#doesn't actually do anything.
#That's just an example of what
#it will look like
DF_3DRMXPSDK::CREATEFPCAMERA_FUNC.call #create our first person camera
#this call will also attach a collision
#animator so our camera won't fall
#through the ground. Now, this function
#also gives permission for the 3D engine
#to handle input on it's own. As you will
#see in the update method, we are not giving
#any instructions in here for the camera to move
#In a later release, I will make it so you can
#use RGSS to tell things to move, but I was
#having problems, and I wanted to show you guys
#a playable demo, so I did it the cheap way
#and I handle most input in the DLL :D
end
def main
lasttime = Time.now #this keeps track of when we call Graphics.update
loop do
if DF_3DRMXPSDK::RUN_FUNC.call == 0 #If the device has been closed
#exit the game
$scene = nil
break
end
DF_Input.update #update the input. This is my own special input module :D
#This input module will be included as well.
time = Time.now #get the time
if time - lasttime > 5 #has it been 5 seconds since we called Graphics.update?
Graphics.update #better call it now
lasttime = Time.now#reset the timer
end
update #call our update method
break if $scene != self #break if scene has chnaged
end
DF_3DRMXPSDK::END3D_FUNC.call #dispose of the 3D window
end #end main
def update
DF_3DRMXPSDK::STEPTEST_FUNC.call #this function is just like calling Graphics.update
#Ok, since I can't use Input to move the camera just yet, take a look here
#This part here will take user input and then ask the DLL what the framerate
#is and print it out.
if DF_Input.pressed?(DF_Input::KEY_F) #if F Key is pressed?
p DF_3DRMXPSDK::GETFPS_FUNC.call #print out the current FPS!
end
end #end update
end# end scene
I never think to use 3D libraries in order to make 2D games. Is it a good idea ? (I'm talking about the power needed by the computer)Yes, it fully supports 2D (though you won't be able to use RGSS sprites, you have to use Irrlicht sprites) BUt you don't have to port your GUI to irrlicht, because irrlicht has a GUI built in :D.