Introduction
Introduction Statistics Contact Development Disclaimer Help
removed old code - gnuskii - GNUSki improved for ascii skiing experience.
git clone git://bitreich.org/gnuskii git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws…
Log
Files
Refs
Tags
README
LICENSE
---
commit 4e94a70eef7056ec4dfe7310ff77d7607789cb2b
parent 97037a7180a9d8941205069aa06aa85d187720b8
Author: Rudolf Olah <[email protected]>
Date: Tue, 23 Jul 2024 20:04:04 -0400
removed old code
Diffstat:
D src/common.h | 32 -----------------------------…
D src/draw.h | 224 -----------------------------…
D src/init.h | 53 ------------------------------
3 files changed, 0 insertions(+), 309 deletions(-)
---
diff --git a/src/common.h b/src/common.h
@@ -1,32 +0,0 @@
-/***************************************
-Name: common.h
-Desc: Contains common functions
-Copyright (C) 2005 Rudolf Olah
-See GPL.txt for more details
-***************************************/
-#ifndef COMMON_H
-#define COMMON_H
-#include <string.h>
-#include <time.h>
-#include <math.h>
-
-int rndInt(int min, int max)
-{
- //Swap numbers to make sure max = the maximum
- int temp = max;
- if (min>max)
- {
- max = min;
- min = temp;
- };
- // Generate a number between min and max inclusive
- int i = rand() % max + min;
- srand(time(NULL)+i*25-rand()*time(NULL));
- while (i < min || i > max)
- {
- i = rand() % max + min;
- };
- //printf("Generated number...%i\n",i); //Debug message
- return i;
-};
-#endif
diff --git a/src/draw.h b/src/draw.h
@@ -1,224 +0,0 @@
-/********************************
-* SkiFree GNU *
-* Rudolf Olah *
-* Copyright 2005 *
-* Released under the GNU GPL *
-********************************/
-#ifndef DRAW_H
-#define DRAW_H
-
-#include <curses.h>
-#include <signal.h>
-#include <stdlib.h>
-#include "common.h"
-
-#define angle_l 0
-#define angle_cl 1
-#define angle_c 2
-#define angle_cr 3
-#define angle_r 4
-
-void add(int x, int y, char d)
-{
- move(y,x);
- addch(d);
-};
-
-class object
-{
-private:
-public:
- int x, y;
- object();
- object(int newX, int newY);
- virtual void draw();
- virtual int getX();
- virtual int getY();
-};
-
-object::object()
-{
- x = 0;
- y = 0;
-};
-
-object::object(int newX, int newY)
-{
- x = newX;
- y = newY;
-};
-
-void object::draw()
-{
-};
-
-int object::getX()
-{
- return x;
-};
-
-int object::getY()
-{
- return y;
-};
-
-
-
-
-class skiDude : public object
-{
-private:
- int nextX, nextY;
- int angle;
-public:
- skiDude(int newX, int newY, int newAngle);
- void crash();
- void draw();
- void setX(int newX);
- void setY(int newY);
- void setAngle(int newAngle);
- int getX();
- int getY();
- int getNextX();
- int getNextY();
- int getAngle();
-};
-
-void skiDude::setX(int newX)
-{
- x = newX;
- nextX = newX + 1;
-};
-
-void skiDude::setY(int newY)
-{
- y = newY;
- switch (angle)
- {
- case angle_l:
- case angle_cl: nextY = newY + 1;
- break;
- case angle_c: nextY = newY;
- break;
- case angle_r:
- case angle_cr: nextY = newY - 1;
- break;
- };
- nextY = newY + 1;
-};
-
-void skiDude::setAngle(int newAngle)
-{
- if (newAngle > 4)
- angle = 4;
- else if (newAngle < 0)
- angle = 0;
- else
- angle = newAngle;
-};
-
-int skiDude::getX() { return x; };
-
-int skiDude::getY() { return y; };
-
-int skiDude::getNextX() { return nextX; };
-
-int skiDude::getNextY() { return nextY; };
-
-int skiDude::getAngle() { return angle; };
-
-skiDude::skiDude(int newX, int newY, int newAngle)
-{
- setAngle(newAngle);
- setX(newX);
- setY(newY);
-};
-
-void skiDude::crash()
-{
- add(x, y, 'X');
-};
-
-void skiDude::draw()
-{
- color_set(COLOR_CYAN, 0);
- switch (angle)
- {
- case angle_l: add(y, x+1, '|');
- add(y+1, x+1, '|');
- break;
- case angle_cl: add(y+1, x+1, '\\');
- add(y+2, x+1, '\\');
- break;
- case angle_c: add(y+1, x, '=');
- break;
- case angle_cr: add(y+1, x-1, '/');
- add(y+2, x-1, '/');
- break;
- case angle_r: add(y, x-2, '|');
- add(y+1, x-2, '|');
- break;
- };
- color_set(COLOR_WHITE, 0);
-};
-
-
-
-
-class tree : public object
-{
-public:
- tree(int newX, int newY);
- void draw();
-};
-
-tree::tree(int newX, int newY)
-{
- x = newX;
- y = newY;
-};
-
-//Draws a tree
-/*
- /|\
- /|\
- |
-*/
-void tree::draw()
-{
- color_set(COLOR_GREEN, 0);
- add(x, y, '/'); add(x+2, y, '\\');
- add(x, y+1, '/'); add(x+2, y+1, '\\');
- color_set(COLOR_YELLOW, 0);
- add(x+1, y, '|'); add(x+1, y+1, '|'); add(x+1, y+2, '|');
- color_set(COLOR_WHITE, 0);
-};
-
-
-
-
-class rock : public object
-{
-public:
- rock(int newX, int newY);
- void draw();
-};
-
-rock::rock(int newX, int newY)
-{
- x = newX;
- y = newY;
-};
-
-//Draws a rock
-/*
- @
-*/
-void rock::draw()
-{
- color_set(COLOR_WHITE, 0);
- add(x, y, '@');
- color_set(COLOR_WHITE, 0);
-};
-
-#endif
diff --git a/src/init.h b/src/init.h
@@ -1,53 +0,0 @@
-/********************************
-* SkiFree GNU *
-* Rudolf Olah *
-* Copyright 2005 *
-* Released under the GNU GPL *
-********************************/
-#ifndef INIT_H
-#define INIT_H
-
-#include <curses.h>
-#include <signal.h>
-#include <stdlib.h>
-
-static void finish(int sig);
-
-//Code from VMS Empire (C-Empire)
-void init_colors()
-{
- start_color();
-
- init_pair(COLOR_BLACK, COLOR_BLACK, COLOR_BLACK);
- init_pair(COLOR_GREEN, COLOR_GREEN, COLOR_BLACK);
- init_pair(COLOR_RED, COLOR_RED, COLOR_BLACK);
- init_pair(COLOR_CYAN, COLOR_CYAN, COLOR_BLACK);
- init_pair(COLOR_WHITE, COLOR_WHITE, COLOR_BLACK);
- init_pair(COLOR_MAGENTA, COLOR_MAGENTA, COLOR_BLACK);
- init_pair(COLOR_BLUE, COLOR_BLUE, COLOR_BLACK);
- init_pair(COLOR_YELLOW, COLOR_YELLOW, COLOR_BLACK);
-};
-
-WINDOW* initStuff(WINDOW* wnd)
-{
- signal(SIGINT, finish); // arrange interrupts to terminate
-
- wnd = initscr(); //initialize the curses library
- attron(A_BOLD);
- keypad(stdscr, TRUE); // enable keyboard mapping
- nonl(); // tell curses not to do NL->CR/NL on outp…
- cbreak(); // take input chars one at a time, no wait…
- noecho(); // don't echo input
-
- init_colors();
- return wnd;
-};
-
-static void finish(int sig)
-{
- endwin();
- /* do your non-curses wrapup here */
- echo();
- exit(0);
-};
-#endif
You are viewing proxied material from bitreich.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.