GithubHelp home page GithubHelp logo

sam-astro / z-sharp Goto Github PK

View Code? Open in Web Editor NEW
657.0 14.0 73.0 2.86 MB

Custom programming interpreter for ZSharp (Z#), a custom game programming language I made

License: MIT License

C++ 71.22% C 8.19% CMake 9.27% Makefile 6.50% Inno Setup 4.82%
language programming-language coding-language custom-language

z-sharp's Introduction



β–Ά Check Out My Youtube Channel, AstroSam


Here Are Some Projects πŸ—

  • πŸ’½ Astro-8
    • 16-bit processor architecture I designed from scratch, and built an accompanying emulator for in C++
  • πŸ’» Z-Sharp (Z#) $\textsf{\color{orange} (no longer in development)}$
    • My own programming language with a cross-platform interpreter, built in C++
  • πŸ’° Distributed-Compute-Coin (DCC)
    • P2P blockchain cryptocurrency allowing developers to purchase distributed computing power to run their compute-heavy applications. Built-in C++
  • 🧠 Neural Networks
    • Always testing new and challenging tasks for AI to learn
  • πŸŒ‰ Polybridge AI
    • Genetic algorithm designed to create structural bridges for holding a load, similar style to polybridge puzzles
  • πŸ” Vault
    • Custom offline password and password-protected data manager
  • 🌱 Plant Disease Recognition
    • Project designed around the identification and classification of plant diseases through images and location data, collected through an autonomous drone system
  • πŸ““ LMark (LaTeX Markdown)
    • Custom Markdown style meant to compile into LaTeX, meant for very fast notetaking with the customizability of LaTeX, but without having to type nearly as much.
  • πŸ•β€πŸ¦Ί Quadruped
    • 3D printed quadruped robot utilizing inexpensive servos and an arduino

z-sharp's People

Contributors

bsikar avatar jukeliv avatar kaputchino avatar rexo35 avatar sam-astro avatar theawesome98-real avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

z-sharp's Issues

Could you create one with classes?

I found out that it is difficult to write a complex program: we need classes.
C++ is actually C with classes, so maybe you can update it and reneme to Z++
I suggest to use this syntax:

class ExampleClass (SuperClass)
{
    func constructor(Param1, Param2, ...)
    {
    // This function is called when the instantiated object is created
    // [some code]
    int this.example_attribute = 10
    super()    // call constructor function of super class
    this.super().ExampleMethod()    // call the static method 'ExampleMethod' of SuperClass
    this.ExampleMethod2()    // This is not defined in ExampleClass, so it will look for this function in SuperClass
    }

    func example_method(Param1, Param2, ...)
    {
    // [some code]
    }

    static int example_static_attr = 15
    // a static attribute/method is the attribute of class
    // e.g.
    // >> ExampleClass ExampleInstantiatedObj = (1, 2, 3)
    // >> printl(ExampleInstantiatedObj.example_static_attr)    => error
    // >> printl(ExampleClass.example_static_attr)                     => 15

    static func example_static_method(Param1, Param2, ...)
    {
    // [some code]
    }
}
ExampleClass a = (1, 2, 3)    // this calls a.contructor(1, 2, 3)
a.example_method()

P.S. This idea is mainly from javascript (constructor right?)
also it should support operator overloading then it looks much better

Simple movement not working?

Describe your issue
Okay so, I'm just starting out on Z#, so I decided to start making a game using it, but i'm getting an issue where the sprite doesn't move? Also, I can't add any empty new lines onto the update function? I get an error for doing that.

To Reproduce
Make a new file, add this onto it

int squareX = 250
int squareY = 250

func Main()
{
    int screenWidth = 500
    int screenHeight = 500

    ZS.Graphics.Init("Title of window", screenWidth, screenHeight)
}

func Start()
{
    Vec2 position = NVec2(squareX, squareY)
    Vec2 scale = NVec2(20, 20)
    float rotation = 0

    global Sprite exampleSprite = ZS.Graphics.Sprite("./square.jpg", position, scale, rotation)
}

func Update()
{
    ZS.Graphics.Draw(exampleSprite)
    if GetKey("W") == true
    {
        squareY -= 10
    }
    if GetKey("S") == true
    {
        squareY += 10
    }
    if GetKey("D") == true
    {
        squareX -= 10
    }
    if GetKey("A") == true
    {
        squareX += 10
    }
}

macOS Not Supported

Describe your issue
So I built this program on macOS but it is not functional, I drag and drop the .zs file, which is Pong-Example-ZSharp And nothing happened

To Reproduce
Steps to reproduce the behavior:
You need to the brew package manager, copy this command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

If you already have the brew package manager

Copy this command:

brew install sdl2_image sdl2_ttf sdl2 git CMake ninja

After you did, clone this project:

git clone https://github.com/sam-astro/Z-Sharp/

Go to the directory:

cd /path/to/Z-Sharp/ZSharp

If youΒ did that, Follow this command:

cmake -B build . -G "Ninja"

And then:

cd build && ninja

Now type ./ZSharp "executable file"

Docs

Will there be Docs or plan for Docs?

Cannot build on FreeBSD

Describe your issue

When building on FreeBSD, it says that SDL2_image is not found, though i have it installed

To Reproduce

On fbsd: git clone ...; cd Z-Sharp/ZSharp; cmake .

Screenshots
If applicable, add screenshots to help explain your problem.

Unable to run Main.cpp.

Can’t run Main.cpp, error. Shown:

image

I am running this on an iPad 10, please fix this bug.

Please fix your float to boost::any conversion errors that I had to patch manually

Describe your issue
The issue has to come down to how data types are handled in c++, for example you cannot assign floats to any. In this case
boost::any, this is the first issue with this code as it looks like it has not ben patched in the source.

To Reproduce
Steps to reproduce the behavior:

  1. Install all Libs for Z#
  2. Go to 'graphics.h'
  3. You see multiple errors in relation to any_cast and type assignments, most notably in:

boost::any SubComponent(std::string componentName) { if (componentName == "position") return position; if (componentName == "position.x") return position.x; if (componentName == "position.y") return position.y; if (componentName == "scale") return scale; if (componentName == "scale.x") return scale.x; if (componentName == "scale.y") return scale.y; return 0; }

Hope you fix this without other devs having to go line by line and fix the types, thanks in advance.
Screenshots
image

Linux requirements missing

Describe your issue
Linux requirements for ZS are missing!

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'README.md'
  2. Look at requirements and find Linux.
  3. Where the requirements at???

Tutorial

Make an the tutorial, for this programming language because i'm really wan't learn this programming language or make docs for programming language how to code and etc.

Arrays and dictionaries

Is your feature request related to a problem? Please describe.
I am trying to make a 3D game using Z#, I want to create an array for the enemies, and a dictionary that stores the enemy's data

Describe the solution you'd like
I want to be able to make arrays and dictionaries.

Describe alternatives you've considered
Having a variable for everything, which was really just spaghetti code
(my code looked sort of like this)

global int enemies_1_health = 100;
global Sprite enemies_1_sprite = ZS.Graphics.Sprite("./enemy.png", NVec2(250, 250), NVec2(20, 20), 0);
global int enemies_1_movespeed = 1;

global int enemies_2_health = 100;
global Sprite enemies_2_sprite = ZS.Graphics.Sprite("./enemy.png", NVec2(250, 250), NVec2(20, 20), 0);
global int enemies_2_movespeed = 3;

and so on...

When following docs, window opens then immediately closes.

As I'm following the docs, the window immediately opens then closes when I run the basic hello world function. The code in my "hello.zs" file is:
func Main() {
Printl("Hello World!")
}

I then save the file and open it with ZSharp.exe, then the issue occurs.

Mac bianaries?

Will there ever be macOS binaries? Or maybe an installation tutorial for macOS would be another easier option.

ZSharp segfaults if the font file that's loaded is missing

Describe your issue
If a font file is loaded that doesn't exist, rather than displaying an error message, the program segfaults
I'm using Ubuntu 20.04.4 LTS

To Reproduce
Steps to reproduce the behavior:

  1. change the arial.ttf in the pong program to something else but don't rename the font
  2. run the program
  3. watch it segfault

Add ZS.Math documentation

The docs are very minimal and are missing a lot of features. There should at least be a page to explain the various mathematical functions in ZSharp.

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.