Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class GameMap {
- has Int $.x_dim;
- has Int $.y_dim;
- has Array[Array[Int]] @.map;
- method generate_new_empty_map() {
- my Array[Array[Int]] @t_map = [[]];
- for 0..$.x_dim -> $x_i {
- for 0..$.y_dim -> $y_i {
- @t_map[$x_i][$y_i] = 0;
- }
- }
- @!map = @t_map;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment