mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 00:31:34 +11:00
Put a ball on screen
This commit is contained in:
parent
26400c97e8
commit
cd1c71fc5e
|
@ -14,6 +14,7 @@
|
||||||
// up correctly.
|
// up correctly.
|
||||||
extern crate agb;
|
extern crate agb;
|
||||||
|
|
||||||
|
use agb::display::object::Size;
|
||||||
use agb::Gba;
|
use agb::Gba;
|
||||||
|
|
||||||
// Put all the graphics related code in the gfx module
|
// Put all the graphics related code in the gfx module
|
||||||
|
@ -39,8 +40,22 @@ mod gfx {
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
let mut gba = Gba::new();
|
let mut gba = Gba::new();
|
||||||
|
|
||||||
|
let _tiled = gba.display.video.tiled0();
|
||||||
let mut object = gba.display.object.get();
|
let mut object = gba.display.object.get();
|
||||||
gfx::load_sprite_data(&mut object);
|
gfx::load_sprite_data(&mut object);
|
||||||
|
object.enable();
|
||||||
|
|
||||||
|
let mut ball = object.get_object_standard();
|
||||||
|
|
||||||
|
ball.set_x(50);
|
||||||
|
ball.set_y(50);
|
||||||
|
|
||||||
|
ball.set_sprite_size(Size::S16x16);
|
||||||
|
|
||||||
|
ball.set_tile_id(4 * 2);
|
||||||
|
|
||||||
|
ball.show();
|
||||||
|
ball.commit();
|
||||||
|
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue