Code Monkey home page Code Monkey logo

cactus-jumper's Introduction

Jumping Game in Java

A game i did during my first year at the University

About

The game was created back in 2017 and was developed in Eclipse Oxygen. I thought it would be of more use in my University era projects here on GitHub than collecting bit-dust on some harddrive of mine.

Screenshot

Screenshot of the game in action

Java version

The Java version i used to compile this game was.

$ javac -version
javac 9.0.4

$ java -version
java 9.0.4

Compiling

Both of the commands must be run from the src directory.

Compile the game.

$ javac -d ../bin ./game/Jumper.java

Copy the images directory to the bin directory.

$ cp ./images/ ../bin/ -r

Running

Run the program. Must be ran from the bin directory.

$ java ./game/Jumper

Note that you can't append .class to the Jumper-file when executing the game.

Screenshot of the terminal

Author notes

One of the things i wanted to try out with this little game was to have the game be rendered using a sprite-array. The array is shifted in different speeds giving the illusion of horizontal movement.

public void initMap() {    
     map = new char[mapHeight][mapWidth];

     map[0] = "----------------------------------------------------------------".toCharArray();
     map[1] = "----------------------------------------%!@@@-------------------".toCharArray();
     map[2] = "--------------------------------------%@@!!!@@------------------".toCharArray();
     map[3] = "------------------------------------%%%@@!!!%%@@----------------".toCharArray();
     map[4] = "-------------------!@-------------------------------------------".toCharArray();
     map[5] = "------------------%%@@---------------------------!!-------------".toCharArray();
     map[6] = "-----------------%!!@@@@-----------------------!!@@!------------".toCharArray();
     map[7] = "--------------@@!!%%@@@!!@@------------------%%%@!!!@@@!--------".toCharArray();
     map[8] = "-------------------------------------------@@%%!!@@!%%@@@-------".toCharArray();
     map[9] = "-----------------------------------------%%!!@@@@@@!!@@@@@------".toCharArray();
    map[10] = "----------!@----------------------------------------------------".toCharArray();
    map[11] = "-------%%!!!!@--------------------------------------------------".toCharArray();
    map[12] = "-----%%%@@@@!!@@@-----------------------------------------------".toCharArray();
    map[13] = "--@@@%%@@!!@@@@@@@@---------------------------------------------".toCharArray();
    map[14] = "----------------------------------------------------------------".toCharArray();
    map[15] = "----------------------------------------------------------------".toCharArray();
    map[16] = "----------------------------------------------------------------".toCharArray();
    map[17] = "----------------------------------------------------------------".toCharArray();
    map[18] = "----------------------------------------------------------------".toCharArray();
    map[19] = "----------------------------------------------------------------".toCharArray();
    map[20] = "----------------------------------------------------------------".toCharArray();
    map[21] = "----------------------------------------------------------------".toCharArray();
    map[22] = "----------------------------------------------------------------".toCharArray();
    map[23] = "----------------------------------------------------------------".toCharArray();
    map[24] = "----------------------------------------------------------------".toCharArray();
    map[25] = "----------------------------------------------------------------".toCharArray();
    map[26] = "5412234532312123356713523635245677532234566321134556556677334335".toCharArray();
    map[27] = "==223??1234+23==2??45+==?22323?++?45==233?==3+3+23=342573=+66=++".toCharArray();
    map[28] = "??=?3345?=+==+=???===++??+?676+=+++==+++=?????=??367++=+??=???=?".toCharArray();
    map[29] = "??=?++===??=?=??=?++?=?=?=+=+++=?+=+=+??==?=?=???==?=?=?=+??=?=+".toCharArray();
    map[30] = "?+++==+=+?===++=+=?=+?=?=+=?=+==?+=+=?==?==?++=?=+=?=?=?++=+=?==".toCharArray();
    map[31] = "=??+?=?=?=+??==?=?==?=?=???=?=+?=??=?=?=?=?=?++=++=+??+?=+?=?=?+".toCharArray();
}

Author

Qulle

cactus-jumper's People

Contributors

qulle avatar

Watchers

 avatar

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.