Skip to content

How to Make a Level

donnaken15 edited this page Jul 14, 2019 · 1 revision

Check this post frequently if you want to see more functions and help.

The Official Guide to Making a Level

Table of Contents

  • File types
  • Variables
  • Constants
  • Functions
  • BEAT.CHEATSHEET
  • CORE.CHEATSHEET

File types:

Beat | *.btb

Core | *.btc

Void | *.btv

Runner | *.btr

Fate | *.btf

Flux | *.btz

These files contain GameMaker Language code where each line is executed per frame.

i.e. = 60 lines equal to 60 fps

room_speed is also modifiable, but will not work

well with high FPS on slower computers.

(that's just how GameMaker works)

If your level uses files outside the game directory,

use the level_directory variable like this:

use_file(level_directory+"filename.txt")

Variables:

room_speed = framerate

soundtype <- sets sound type (i.e. for beat: 0 = transition, 1 = descent, 2 = growth)

special <- powerup mode

bgcolor <- overrides background color

nofail

nowin

score

combo

multi

mode

test <- ???

bot <- nearly functional autoplay

bpm <- mega colors for the HUD are speed dependent of this

(changes every amount of frames entered)

timeline_loop <- loops level

mode_animation <- sets y position of the main hud

Constants:

buildtime

beat_normal <- 0

beat_orange <- 1

beat_pink <- 2

beat_follow <- 3

beat_blue <- 4

beat_nextsc <- 5

beat_cyan1 <- 6

beat_cyan2 <- 7

beat_still <- 8

beat_green <- 9

beat_violet <- 10

beat_powerup <- 11

beat_custom <- 99

center <- 360

top <- 151

bottom <- 569

powerup_none <- 0

powerup_large <- 1

powerup_challenge <- 2

powerup_small <- 2

powerup_double <- 3

powerup_dual <- 3

powerup_series <- 4

powerup_multiply <- 5

mode_nether <- 0

mode_hyper <- 1

mode_mega <- 2

mode_super <- 3

mode_super <- 4

mode_ultra <- 5

mode_giga <- 6

mode_meta <- 7

core_north <- 0

core_east <- 1

core_south <- 2

core_west <- 3

Functions:

beat_beat(type, y position, speed, direction, ...)

Creates a beat.

core_beat(type, side (0=n,1=e,2=s,3=w), position (0.0-1.0), speed, direction, lifetime (def. 180), ...)

Creates a beat.

Beat types:

0 = yellow (normal)

1 = orange

2 = pink

3 = very bright blue white (follows paddle)

4 = blue (plays mostly during measures of a song)

5 = rainbow (transition to next part of the level)

6 = cyan (bounces off border)

7 = cyan (moves anywhere or flashes)

8 = bright yellow (stays for a bit at the paddle after hit)

9 = green flashing beat

10 = violet

11 = powerup (large paddle,challenge,double paddle)

99 = custom beat

skip(frame in level)

Skips to position in level.

skiprel(negative or positive value)

Skips to position in level relative to current frame.

pause(frame amount)

Pauses level code execution.

Good for level compression.

toggle(variable)

Toggle variable true or false.

music(filename)

Set music for level (must be vorbis OGG file).

music_mega(filename)

Set overlapping mega music for level.

music_stop(filename)

Stops level music.

music_loop(filename)

Loops music file.

music_loop_mega(filename)

Set overlapping mega music for level but looped.

BEAT.CHEATSHEET

Examples:

To create a normal beat:

beat_beat(0,360,10,0)

Result: Creates a beat from right center at 0 degrees.

To create an orange beat that bounces back:

beat_beat(1,593,10,0,2,1.15)

Extra arguments: bounce x velocity, bounce y velocity

Optional arguments: keep vspeed (bool), hits (times it will bounce back)

Result: Creates a beat from the bottom right and bounces to the top of the screen.

To create a bright yellow beat that stays at the paddle:

beat_beat(8,360,10,0,360)

Extra arguments: time in frames

Result: Creates a beat from the right center and stays at the paddle for 6 seconds if running at 60fps.

Tip: You can use

room_speed*seconds

or

fps*seconds

to make it so that the beat will still stay for however many seconds you want it to stay without worrying about frame rate change. This is kind of like delta timing, but is only available in GameMaker Studio unless a DLL/extension is made just for that purpose.

To create two beats where one is fired a second after:

beat_beat(0,360,10,0)pause(60)

beat_beat(0,360,10,0)

To create a powerup beat:

beat_beat(11,360,10,0,0,600)

Extra arguments: powerup type, powerup time, number of beats (if powerup is challenge or 1)

Result: Creates a powerup beat that makes the paddle larger for 10 seconds if running at 60fps.

Powerup types:

0 - large paddle

1 - challenge

2 - dual paddles

To create a following beat:

beat_beat(3,10,5,0)

Arguments: speed, follow intensity, invert (can be 0 or 1) (optional)

Result: Creates a beat that follows the paddle, or follow it backwards if the invert argument is 1.

The lower the follow intensity is, the slower the beat will align to the paddle vertically, the higher it is, the faster it will.

To create a cyan beat that bounces off the walls:

beat_beat(6,360,10,0,1,1,0)

Extra arguments: bounce speed numerator, bounce speed denominator, starting vspeed (optional)

Result: Creates a beat that bounces off the bottom of the screen and to the center 3 times.

To create a green flashing beat:

beat_beat(9,360,10,0,8)

Extra arguments: flash rate (default: 4)

Result: Creates a beat that flashes on and off on quarter second intervals.

The flash rate determines the speed of the flashing on and off based on the beats

per minute value, in which the speed becomes the BPM divided by the value provided.

To create a beat with your own code:

beat_beat(99,360,10,0,color,creation code,step code,drawing code)

CORE.CHEATSHEET

Examples:

To create a normal beat:

core_beat(0,0,0.25,5,0,600)

Result: Creates a beat at the top left at 0 degrees, lasting six seconds.

For hexadecimals, GameMaker's

format works like this:

000000

7FFFFF

789ABC

105132

Note, this guide may update how to use these functions, so if you have an old level with functions from older versions, be sure to update your level to be up to date with the latest build of the engine.

If you want to know how to do something specific that isn't listed here, you can create an issue on the GitHub repository for this game or make a reply to this thread.