Giter Club home page Giter Club logo

gamejam's Introduction

gamejam's People

Contributors

wnwoghd22 avatar

Stargazers

 avatar

Watchers

 avatar

gamejam's Issues

HTML building - Syntax Error

Un weird error occurred - In the spawn_enemy() function, I used two static array fields.
After building the HTML5 package, the Only I can see was a black screen. So I checked that JS code :
스크린샷(31)
I found that an unnecessary "," token was inserted, but don't have any idea that what ~.prototype.yy_staticInitialiser ... is for and why the token is inserted.
The names were converted into enigmatic words... so it made me hard to find exactly WHERE was the problem.
But eventually found that the spawn_enemy() was the point that the error occurred.
I changed some words, syntax, order... and finally handled - switch keyword "static" to "var".
스크린샷(32)
I assume that two static variables in a function may occur a problem if build an HTML5 package.

Chrome Policy : No autoplay

Tried to add background music on the top menu, and it worked well while test playing.
However, it seems that have a problem when tried on HTML5 mode the sound wasn't played, but after pressing some keys sound began. So checked the console.

It says, "WebAudio autoplay test failed: DOMException: play() failed because the user didn't interact with the document first."
I noticed that Chrome keeps their browser from "autoplay" any contents by the policy.

GameMakerStudio 2 : HTML5 package - function parameter

I used the parameter named "health" to assign enemy health, and it worked fine with test mode.
But in HTML5 mode, the function call ignored this parameter and assigned 100 instead.

I changed the parameter name "health" to "_health" (added underbar) and it was fixed.
Assume that if you use a parameter name that already exists in the "built-in" field, it may occur unexpected result.

audio file size

Until yesterday, I suffered from the extremely large size of audio files.

My co-worker gave me an additional soundtrack but due to the size limit (5MB), I could not include that file.
A strange thing is that - very illogical - the total size of raw audio files is only 1 MB, and other scripts and image files are under 1MB, but the package became over 6MB. What happened?

I checked subdirectories in the package and found that audio files were enlarged. Then how can I handle this problem? It was simple - audio quality.

before
In Sound Editor, we can find "Sample Rate" and "Bit Rate". The default values of those are 44100 and 128, and it is high-quality audio. 44.1kHz and 128kbp? It's too much!

after
Well, then adjust it! The package size became only 1.8 MB. I've made it.

There're many tips for optimizing audio for Gamemaker, so no more detail is needed, but if you want to reduce file size first, then adjust audio quality.

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.