Skip to content

Commit

Permalink
beta
Browse files Browse the repository at this point in the history
  • Loading branch information
Spu7Nix committed Dec 22, 2020
1 parent 10c499d commit 40499d2
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 9 deletions.
2 changes: 1 addition & 1 deletion spwn-lang/src/levelstring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ pub fn append_objects(
}
}

println!("group_map: {:?}", id_maps[0]);
//println!("group_map: {:?}", id_maps[0]);

fn serialize_obj(mut trigger: GDObj) -> String {
let mut obj_string = String::new();
Expand Down
2 changes: 1 addition & 1 deletion spwn-lang/src/optimize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ fn optimize_from<'a>(

if let Some(targets) = targets {
if targets.is_empty() {
println!("NO TARGET (deleted)");

return false;
}
// else {
Expand Down
20 changes: 18 additions & 2 deletions spwn-lang/test/calc3.spwn
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,33 @@ on(gamescene.button_b(), {

current_op = counter()

sec_to_main = { sec.add_to([main], speed = 10) }

on(gamescene.button_a(), {
if selected <= 9 {
//number

main.multiply(10, speed = 10)
main.add(selected.to_const(0..10))
} else if selected == 10 {
main.reset(speed = 10)
} else if selected == 11 {
//solve
?g!
if current_op == 0 {
//plus
sec_to_main!
} else if current_op == 1 {
//minus
main.subtract_from([sec], speed = 10)
sec_to_main!
} else if current_op == 2 {
//mult
main.multiply(sec, speed = 7)
sec.reset(speed = 10)
} else if current_op == 3 {
//div
sec.divide(main, speed = 7)
sec_to_main!
}
} else {
//operator
current_op = selected.to_const(12..17) - 12
Expand Down
12 changes: 7 additions & 5 deletions spwn-lang/test/test.spwn
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
a = counter(1i)
a += 444
b = counter(2i)
b += 11
a /= b
main = counter(1i)
sec = counter(2i)

main += 222
sec += 2

main.divide(sec, speed = 5)

0 comments on commit 40499d2

Please sign in to comment.