Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
c742df65c7 | ||
|
74f8c5f04f |
@ -4,23 +4,22 @@ use pancurses::{initscr, endwin, noecho, curs_set, cbreak, Input};
|
|||||||
const SCREENWIDTH: i32 = 15;
|
const SCREENWIDTH: i32 = 15;
|
||||||
const SCREENHEIGHT: i32 = 15;
|
const SCREENHEIGHT: i32 = 15;
|
||||||
|
|
||||||
|
|
||||||
struct Character {
|
struct Character {
|
||||||
row: i32,
|
row: i32,
|
||||||
col: i32,
|
col: i32,
|
||||||
symbol: char
|
symbol: char
|
||||||
}
|
}
|
||||||
|
|
||||||
fn new_character(row: i32, col: i32, symbol: char) -> Character{
|
impl Character {
|
||||||
let mut a = Character {
|
fn new(row: i32, col: i32, symbol: char) -> Character {
|
||||||
|
Character {
|
||||||
row: row,
|
row: row,
|
||||||
col: col,
|
col: col,
|
||||||
symbol: symbol,
|
symbol: symbol,
|
||||||
};
|
}
|
||||||
return a;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
||||||
/*Create the window*/
|
/*Create the window*/
|
||||||
@ -32,10 +31,10 @@ fn main() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
getmaxyx(stdscr(), &mut max_y, &mut max_x);
|
// getmaxyx(stdscr(), &mut max_y, &mut max_x);
|
||||||
|
|
||||||
/*Create our dude*/
|
/*Create our dude*/
|
||||||
let draco = new_character(5,5,'@');
|
let draco = Character::new(5,5,'@');
|
||||||
|
|
||||||
/*Set some ncurses config*/
|
/*Set some ncurses config*/
|
||||||
init();
|
init();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user