Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add land mode #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion sl.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ int my_mvaddstr(int y, int x, char *str);
int ACCIDENT = 0;
int LOGO = 0;
int FLY = 0;
int LAND = 0;
int C51 = 0;

int my_mvaddstr(int y, int x, char *str)
Expand All @@ -67,12 +68,13 @@ int my_mvaddstr(int y, int x, char *str)

void option(char *str)
{
extern int ACCIDENT, LOGO, FLY, C51;
extern int ACCIDENT, LOGO, FLY, LAND, C51;

while (*str != '\0') {
switch (*str++) {
case 'a': ACCIDENT = 1; break;
case 'F': FLY = 1; break;
case 'L': LAND = 1; break;
case 'l': LOGO = 1; break;
case 'c': C51 = 1; break;
default: break;
Expand Down Expand Up @@ -139,6 +141,10 @@ int add_sl(int x)
if (x < - LOGOLENGTH) return ERR;
y = LINES / 2 - 3;

if (LAND == 1) {
y = 1.5 * LINES - (x / 6) - (COLS / 6) - LOGOHEIGHT;
py1 = -2; py2 = -4; py3 = -6;
}
if (FLY == 1) {
y = (x / 6) + LINES - (COLS / 6) - LOGOHEIGHT;
py1 = 2; py2 = 4; py3 = 6;
Expand Down Expand Up @@ -183,6 +189,10 @@ int add_D51(int x)
if (x < - D51LENGTH) return ERR;
y = LINES / 2 - 5;

if (LAND == 1) {
y = 1.5 * LINES - (x / 7) - (COLS / 7) - D51HEIGHT;
dy = -1;
}
if (FLY == 1) {
y = (x / 7) + LINES - (COLS / 7) - D51HEIGHT;
dy = 1;
Expand Down Expand Up @@ -223,6 +233,10 @@ int add_C51(int x)
if (x < - C51LENGTH) return ERR;
y = LINES / 2 - 5;

if (LAND == 1) {
y = 1.5 * LINES - (x / 7) - (COLS / 7) - C51HEIGHT;
dy = -1;
}
if (FLY == 1) {
y = (x / 7) + LINES - (COLS / 7) - C51HEIGHT;
dy = 1;
Expand Down