mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 08:11:33 +11:00
use object managed
This commit is contained in:
parent
4bbc1eb415
commit
698e3ff523
|
@ -11,7 +11,7 @@
|
||||||
#![no_main]
|
#![no_main]
|
||||||
|
|
||||||
use agb::{
|
use agb::{
|
||||||
display::object::{Graphics, Object, ObjectController, Tag},
|
display::object::{Graphics, Object, ObjectManaged, Tag},
|
||||||
include_aseprite,
|
include_aseprite,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ struct Paddle<'obj> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'obj> Paddle<'obj> {
|
impl<'obj> Paddle<'obj> {
|
||||||
fn new(object: &'obj ObjectController<'_>, start_x: i32, start_y: i32) -> Self {
|
fn new(object: &'obj ObjectManaged<'_>, start_x: i32, start_y: i32) -> Self {
|
||||||
let mut paddle_start = object.object_sprite(PADDLE_END.sprite(0));
|
let mut paddle_start = object.object_sprite(PADDLE_END.sprite(0));
|
||||||
let mut paddle_mid = object.object_sprite(PADDLE_MID.sprite(0));
|
let mut paddle_mid = object.object_sprite(PADDLE_MID.sprite(0));
|
||||||
let mut paddle_end = object.object_sprite(PADDLE_END.sprite(0));
|
let mut paddle_end = object.object_sprite(PADDLE_END.sprite(0));
|
||||||
|
|
|
@ -42,7 +42,7 @@ Now the paddle will display correctly. It's rather awkward to use, however, havi
|
||||||
```rust
|
```rust
|
||||||
// change our imports to include what we will use
|
// change our imports to include what we will use
|
||||||
use agb::{
|
use agb::{
|
||||||
display::object::{Graphics, Object, ObjectController, Tag},
|
display::object::{Graphics, Object, ObjectManaged, Tag},
|
||||||
include_aseprite,
|
include_aseprite,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ struct Paddle<'obj> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'obj> Paddle<'obj> {
|
impl<'obj> Paddle<'obj> {
|
||||||
fn new(object: &'obj ObjectController<'_>, start_x: i32, start_y: i32) -> Self {
|
fn new(object: &'obj ObjectManaged<'_>, start_x: i32, start_y: i32) -> Self {
|
||||||
let mut paddle_start = object.object_sprite(PADDLE_END.sprite(0));
|
let mut paddle_start = object.object_sprite(PADDLE_END.sprite(0));
|
||||||
let mut paddle_mid = object.object_sprite(PADDLE_MID.sprite(0));
|
let mut paddle_mid = object.object_sprite(PADDLE_MID.sprite(0));
|
||||||
let mut paddle_end = object.object_sprite(PADDLE_END.sprite(0));
|
let mut paddle_end = object.object_sprite(PADDLE_END.sprite(0));
|
||||||
|
|
Loading…
Reference in a new issue