Skip to content

The 'Wave' Vademecum. A repository to save all implementations of the same wave function to different languages.

License

Notifications You must be signed in to change notification settings

AntikoreDev/wave

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The 'Wave' Vademecum

Repo size License Pull Requests Issues
Contributors Stars

This is a repository for storing all implementations of the same wave function from a Shaun Spalding's GameMaker Studio video in different programming languages.

When I watched that video I started to use that function a lot in my games, then began to implement it in other languages for other of my projects, and that ended up in this repository. (See video here)

See the original implementation (as of my knowledge): main.gml

What's this function.

This 'wave' function basically receives two numbers and a duration, and the function will return a value between those 2 based on current time. This is an example for the python implementation (For sake of simplicity, imagine the wave function has already been imported or added)

import time

while True:
  time.sleep(0.05)
  print("#" * round(wave(0, 20, 1)))

Outputs

##
#####
#########
#############
################
###################
####################
####################
##################
###############
###########
#######
###
#

#
##
######
#########
#############
#################
###################
####################
###################
#################
##############
###########
#######
###
#

The only really difficulty into making a new implementation is finding out how to get the current time in milliseconds. Any variable that increases constantly in milliseconds should work fine though.

Contributions

To contribute to this project your submission may accomplish the following requirements:

  • The name of the file should be main if it's using the base language or a significative name if its using a framework. (f.e. unity.cs)
  • There should be a folder for every language submitted, and submissions should be in the correct folder.
  • You should try to keep the script at a bare minimum, just the function and any additions that are required for it to work.
  • Every submission here falls under Unlicense license without exception.

Also, normal language implementations should be under the folder languages/common, any other language may go to languages/misc (You may want to create it if is not already done...)

Special Thanks

  • The guy whoever made the original script ❤️

About

The 'Wave' Vademecum. A repository to save all implementations of the same wave function to different languages.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks