initial 1.3.0
This commit is contained in:
92
template/src/logic2.txt
Normal file
92
template/src/logic2.txt
Normal file
@@ -0,0 +1,92 @@
|
||||
// ****************************************************************************
|
||||
//
|
||||
// Logic 2: First room
|
||||
//
|
||||
// ****************************************************************************
|
||||
#include "defines.txt"
|
||||
if (new_room) {
|
||||
load.pic(room_no);
|
||||
draw.pic(room_no);
|
||||
discard.pic(room_no);
|
||||
set.horizon(60);
|
||||
// The next 6 lines need only be in the first room of the game
|
||||
if ((prev_room_no == 1 || // just come from intro screen
|
||||
prev_room_no == 0)) { // or just started game
|
||||
position(ego,76,90);
|
||||
status.line.on();
|
||||
accept.input();
|
||||
}
|
||||
|
||||
load.view(2); // ego in water -view
|
||||
ignore.objs(ego); // allow ego to walk over objects
|
||||
|
||||
// Show test object on the floor if the player hasn't piced it up
|
||||
if (!has("test object")) {
|
||||
animate.obj(o2);
|
||||
load.view(221);
|
||||
set.view(o2,221);
|
||||
position(o2,70,130);
|
||||
set.priority(o2,4); // = floor
|
||||
draw(o2);
|
||||
}
|
||||
|
||||
// Check what room the player came from and position them on the
|
||||
// screen accordingly here, e.g:
|
||||
// if (prev_room_no == 5) {
|
||||
// position(ego,12,140);
|
||||
// }
|
||||
draw(ego);
|
||||
show.pic();
|
||||
}
|
||||
|
||||
// Change ego's view when on water
|
||||
if (ego_on_water) {
|
||||
set.view(ego,2);
|
||||
}
|
||||
else {
|
||||
set.view(ego,0);
|
||||
}
|
||||
|
||||
if (said("look")) {
|
||||
if (!has("test object")) {
|
||||
print("This is a test room. There is a test object on the ground.");
|
||||
} else {
|
||||
print("This is an empty test room.");
|
||||
}
|
||||
}
|
||||
|
||||
if (said("get","test object")) {
|
||||
if (!has("test object")) {
|
||||
if (center.posn(ego, 64,125, 80,135)) {
|
||||
get("test object");
|
||||
erase(o2);
|
||||
score += 1;
|
||||
print("Ok. It looks like some kind of text plate.");
|
||||
} else {
|
||||
print("It's too far away. Move closer.");
|
||||
}
|
||||
} else {
|
||||
print("You already got it.");
|
||||
}
|
||||
}
|
||||
|
||||
//if (ego_edge_code == horizon_edge) { // ego touching horizon
|
||||
// new.room(2);
|
||||
//}
|
||||
if (ego_edge_code == right_edge) { // ego touching right edge of screen
|
||||
new.room(2);
|
||||
}
|
||||
if (ego_edge_code == bottom_edge) { // ego touching bottom edge of screen
|
||||
new.room(2);
|
||||
}
|
||||
if (ego_edge_code == left_edge) { // ego touching left edge of screen
|
||||
new.room(2);
|
||||
}
|
||||
return();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user