How do I add background music without button clicking?

Just started using Construct 2? Post your questions here

Post » Sun Apr 13, 2014 6:06 pm

Hey!

I'm a very new user to the C2, and trying to make an infinite scrolling game as a little project I need to do for school. I have so far liked the program, but now I'm a bit stuck in 2 things:

1. I'm still unsure how I should make animations with C2, but I'm guessing I need another program and some pixel art to do so. This isn't what I came to ask, though feel free to give advice.

2. I just can't figure out how to add BGM into my game. I have the file imported (as m4a) and it's in the music folder. However, C2 doesn't seem to recognize it at all. I can't get it to work with "play (by name)" and such. As a side note, it doesn't seem to even tag it properly. The audio does work though since I got the jump SFX to work. What's more is that I have yet to find somethign which would tell me how the audio works without actually pressing anything (you load the game, and the music starts right away)

With a quick search in here and Google, I didn't find any clear answer. I decided to register here to get an answer.

I appreciate your help beforehand.
B
2
Posts: 2
Reputation: 154

Post » Mon Apr 14, 2014 5:36 am

For the Audio, the simple way is and event "On Start of Layout" or "On Loader Layout Complete"... "On Load Complete". Be carefull with the conversion, sometimes it is not possible to convert with construct. And you will need an ogg file for the music, not m4a.

About the animation, it is frame per frame so yes, you need to draw it by yourself (and that why we all start from a square). I suggest you Gimp, it is free. After, just search in the Tutorial section for "Animation", you will find what you are looking for
B
15
S
4
Posts: 57
Reputation: 1,792

Post » Mon Apr 14, 2014 2:51 pm

for Animation search & download these FREE tools: Inkscape to draw with and Spriter to animate. Watch the Spriter youtube demo first to give you some ideas.

for audio, depending on the browser you are previewing your game in, you might need a different audio file format. So always import both ogg and m4a files to your project.
i.e.
backgroundmusic.ogg
backgroundmusic.m4a

In C2 "Actions" happen based on an "Event" that triggers them. So if you make a Button Object and put it in your layout, if you make an Event called Button->OnClicked (this is an event - something happened, the user clicked the button) then for the Action you put Play"BGM" etc.. your background music will then play.
B
88
S
29
G
14
Posts: 1,154
Reputation: 15,003

Post » Mon Apr 14, 2014 3:48 pm

Alright, I got the music to work now. Thanks!

Also, thanks about saying about Spriter. I'll look into it
B
2
Posts: 2
Reputation: 154


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest