Git Product home page Git Product logo

trispace's Introduction

TriSpace

An elite-like space game for the FunKey S. Includes procedural generation of star systems, space combat, ship upgrades, contracts and more.

Controls

D-Pad: Ship controls (up/down/roll left/roll right) A: Fire weapons B: Fire missile X/Y: Accelerate/Decelerate ship Start: Switch to starmap Select: Activate autodocking L/R: Station: Switch tabs

Building

Required libraries (debian package names):

libsdl1.2-dev
libsdl-image1.2-dev
libsdl-mixer1.2-dev
libmikmod-dev

KeyCraft uses TinyGL for rendering.

Since the FunKey uses 16-bit color, adjusting include/zfeatures.h is required:

#define TGL_NO_DRAW_COLOR 0xf81f

#define TGL_FEATURE_16_BITS        1
#define TGL_FEATURE_32_BITS        0

Compile TinyGL via

gcc -O3 -flto -c *.c
ar rcs libTinyGL.a *.o

for linux and via

/opt/funkey-sdk/usr/bin/arm-linux-gcc -O3 -flto -c *.c -march=armv7-a+neon-vfpv4 -mtune=cortex-a7 -mfpu=neon-vfpv4
/opt/funkey-sdk/usr/bin/arm-linux-gcc-ar rcs libTinyGL-fk.a *.o

for the FunKey.

Then adjust the TINGYGL_LIB and TINYGL_INCLUDE paths in the makefile and funkey.mk.

Finally, you can compile the project with make.
make debug creates a debug build for linux.
make TARGET=funkey creates a FunKey build.
make oclean cleans up object files. Required before switching between linux and FunKey builds.
./package.sh combines several commands to create a ready-to-go OPK file for the FunKey.

trispace's People

Contributors

robbi-blechdose avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

trispace's Issues

Some minor code bugs

I love TriSpace and am currently modifying it and playing around with it. Here are some quick bugs I've found before I completely forget:

In starmap.c:

static GLuint sunTextures[2];

^ You have 3 suns so this is currently overflowing - should be [3]

In spacedust.c:

                spacedust[i].x = spacedust[i].x * cosf(angle) - spacedust[i].y * sinf(angle);
                spacedust[i].y = spacedust[i].x * sinf(angle) + spacedust[i].y * cosf(angle);

^ You want to be saving the result of what the new spacedust[i].x should be and assigning it after calc'ing spacedust[i].y. Currently if you roll in circles you'll see the stardust gradually gets closer to the middle (and that's because the new .x is being used to create the new .y)

In equipui.c:

    char buffer[29];
    char name[21];
    char status[4];

^ You are currently overflowing these buffers.
e.g.

sprintf(buffer, "%-19s %4d %4s", name, getPriceForEquipment(i), status);

19+1+4+1+4+1(null terminator) = 30
This happens in other areas too - no need to be quite so tight with our stack on FunKey (so could just make all string arrays [100] :) )

main.c

transferCargo(&player.hold, &stationHold, uiTradeCursor, &starSystem.info, 1);

^ This should be passing &starSystem.info.characteristics not &starSystem.info for these calls to transferCargo

TriSpace is absolutely brilliant - thanks for all the work you clearly put into this and for releasing the source.

-Nick (aka LordEnum)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.