-
Notifications
You must be signed in to change notification settings - Fork 117
Expand file tree
/
Copy pathYASC.java
More file actions
117 lines (77 loc) · 1.8 KB
/
YASC.java
File metadata and controls
117 lines (77 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
package ie.tudublin;
import java.util.ArrayList;
import processing.core.PApplet;
import processing.core.PVector;
public class YASC extends PApplet
{
public boolean[] keys = new boolean[1024];
public void keyPressed()
{
keys[keyCode] = true;
}
public void keyReleased()
{
keys[keyCode] = false;
}
// Generic
public ArrayList<GameObject> gameObjects = new ArrayList<GameObject>();
public void settings()
{
size(500, 500);
PVector a = new PVector(10, 10);
PVector b = new PVector(20, 20);
b = a;
b.x = 30;
b.y = 30;
println(a);
}
String s3 = "Hello";
public void setup() {
Ship ship = new Ship(width / 2, height / 2, 50, 70, this);
Ship ship1 = new Ship(100, 50, 50, 6, this);
gameObjects.add(ship);
gameObjects.add(ship1);
gameObjects.add(new HealthPowerup(60, 100, 0, 255, this));
colorMode(HSB);
String s = "I love Star Trek";
s += " & 200AD";
String s1 = s.substring(2, 6);
println(s.substring(7, 11));
println(s.indexOf("Trek"));
println(s.startsWith("Ilove"));
String ss3 = "Hell";
String temp = "o";
String s2 = "Hello";
String s4 = ss3 + temp;
println(s4 == s2);
println(s4.equals(s2));
println();
background(0);
/*startsWith
endsWidth
substring
indexOf
s1.chatAt
s1.lastIndexOf
s1.toUpperCase()
s1.compareTo(s)
s1.equals
s1.
println(s1);
*/
}
public void draw()
{
fill(0, 20);
noStroke();
rect(0, 0, width, height);
for(int i = gameObjects.size() - 1 ; i >= 0 ; i --)
{
GameObject b = gameObjects.get(i);
b.render();
b.update();
}
fill(255);
text("Game Objects: " + gameObjects.size(), 50, 50);
}
}