1
Graphics / Make stuff big. Really big.
« on: May 14, 2008, 07:25:11 am »
Well. Yes.
How stupid of me.
Thanks.
How stupid of me.
Thanks.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
int table[] = { 0,9,1,8,2,7,3,6,4,5 }
int random()
{
int v = table[i];
i++;
if( i > 9 ) i = 0;
return v;
}
if (Angle > 0)
{
Angle += 360;
}
if (Angle > 360)
{
Angle -= 360;
}
if (Angle < 0)
{
Angle += 360;
}
if (Angle >= 360)
{
Angle -= 360;
}
if (Angle > 0)
{
Angle += 360;
}
if (Angle > 360)
{
Angle -= 360;
}
x = x + cos(angle) * speed;
y = y + sin(angle) * speed;
tiles_gfx = Image.new("tiles.png")
tiles_gfx.setSmooth( false )
tiles = Sprite.new( tiles_gfx )
# ... later in the source
tiles.setSubRect( IntRect.new(0,0,8,8) )
win.draw( tiles )
# The graphics mode we want to use
mode = VideoMode.new( 640,480, 32)
# Open up a window
win = RenderWindow.new( mode, "My test", 0 )
# Set up a view
view = View.new( FloatRect.new(0,0,160,120) )
require 'RubySFML'
include SFML
# The graphics mode we want to use
mode = VideoMode.new( 640,480, 32)
# Open up a window
win = RenderWindow.new( mode, "My test", 0 )
# Set up a view
view = View.new( FloatRect.new(0,0,160,120) )
# Misc settings
win.showMouseCursor( false )
win.useVerticalSync( true )
# Load images
tiles_gfx = Image.new("tiles.png")
tiles = Sprite.new( tiles_gfx )
# Main loop
done = false
while !done
while e = win.getEvent()
done = true if e.type == Event::Closed or
(e.type == Event::KeyReleased and e.code == Key::Escape)
end
# GFX
win.draw( tiles )
win.display()
sleep(0.01)
end