• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

HTML5 my 2 last porblems.. pls

D

dimiczy

Guest
Hello
I come to you because I finished my games but I still have two last little problem that persists and I can not settle!

1 - my main music is superimposed when my character dies have places to simply start again which create loops of music that melts badly in the ear ...

2 - I created my game on a computer with a screen of 15.6 "16: 9 IPS (1920 x 1080) and qand I run my html on a screen smaller my game does not fit the screen and remains at the size or I created it ... which makes it impossible to play people with a smaller screen ..
I hope you can help me! please
 
Z

zendraw

Guest
1- save tha playng song to a variable and then just stop it or just stop all sounds.
2- it depends. must provide code how u port your game to the screen, what do u use.
 
D

dimiczy

Guest
1- save tha playng song to a variable and then just stop it or just stop all sounds.
it is not possible to say "when I die the sound starts again" ?? because on windows try that working but not on HTML

2- it depends. must provide code how u port your game to the screen, what do u use.
I did not really understand, I only use Game Maker studio...
 
Z

zendraw

Guest
yes it is possible, you simply first stop the sound, and then play it again, or perhaps set the position of the song at 0, but i say its best you simply stop the sound and start it anew.

for html you must resize the game manually. to fit the browser. i will see for some code that i have for this thing.
 
Z

zendraw

Guest
so this is the code i use for html5 scaling
Code:
///outside the script
width=browser_width;
height=browser_height;
scr_html_scale(base_width, base_height, width, height, true);
Code:
///in the script
var bw=argument0;//base_width/room_width
var bh=argument1;//base_height/room_height
var wt=argument2;//width/browser_width
var ht=argument3;//height/browser_height
var wn=argument4;//windowed?

var aspect=bw/bh;//base_width/base_height

if ((wt/aspect)>ht)
{
    window_set_size(ht*aspect, ht);
}
else
{
    window_set_size(wt, wt/aspect);
}

if (wn)
{
    window_center();
}
youll figure it out where to run it?
 
Z

zendraw

Guest
just put this in a step event that runs aways. aka an object that is aways present in the game.
width=browser_width;
height=browser_height;
scr_html_scale(base_width, base_height, width, height, true);

that shuld be enough.

also put it somewhere that will run when the game starts. now its difficult for me to say where since i have no idea how you have build ur game.
 
D

dimiczy

Guest
just put this in a step event that runs aways. aka an object that is aways present in the game.
width=browser_width;
height=browser_height;
scr_html_scale(base_width, base_height, width, height, true);

that shuld be enough.

also put it somewhere that will run when the game starts. now its difficult for me to say where since i have no idea how you have build ur game.
ohhhh !!!! if thats work you are my hero ! i put that on all my sprit ? or that on only one ? :D
 
Z

zendraw

Guest
what kind of question is that :D have you coded your game? if not give it to the guy that coded it and tell him to put it in a step event of an instance that runs aways. or perhaps ask someone trustworthy to do it. its 1 min work.
 
D

dimiczy

Guest
what kind of question is that :D have you coded your game? if not give it to the guy that coded it and tell him to put it in a step event of an instance that runs aways. or perhaps ask someone trustworthy to do it. its 1 min work.

i coded my game with sweat .. i tried to put it in the "creat" event in my o_player but that dont work "run full program"

and i am alone in that project.. my friend know nothing
 
Z

zendraw

Guest
ok just make a new object, make that object persistent, put it that it will be created when the game starts and put the code in that object`s create event and step event.
 
D

dimiczy

Guest
ok just make a new object, make that object persistent, put it that it will be created when the game starts and put the code in that object`s create event and step event.
ok sorry , i tryed the script code but that not work in Html ( i am only on html5 )
he said " unknown fonction on script html_set_size ect... "

same for outside script code :'(
 
Last edited by a moderator:
Top