Guizmus's Recent Forum Activity

  • What EncryptedCow said is more important than you think partTimeCrazy. The browser, depending on the browser, don't access a local file the same way that it does when it's online. Maybe what you used works on IE/FF and not chrome, maybe something else wouldn't work on either. Just try to put your project online, test it with chrome, and then see if there is still a problem.

    Dropbox provides an easy way to publish HTML projects, but you can also set up a local server with wamp, or I don't know.

  • Hum... screens link are dead... My bad.

    The only important thing in my solution, and that could be implemented on whatever project (maybe ^^) is the maths themselves. If you accept to store both baseWidth (ship and bar), you can update the bar easily.

    In particular, for the height, if you replace all the "set height to" by a call to a function that would set the height you want after multiplying it by ship.width/ship.baseWidth (basicaly the current scale of the ship), you should have the exact scale you want for the bar.

    The only problem I ran into that seems hard to go by (not impossible, hard) is the origin point. I had to put it top left for both objects. If you don't do so, you will have to calculate the relative movement of the origin, as the Pin behavior don't seem to apply to it.

  • DropBox is very nice to share files on this forum.

    Here is an example of the simpliest item store I could think of. It's just to explain how to code it in C2, as you don't seem to find your way for now, and you can try to add more item types from it, ...

    Have fun !

  • Did you try anything ? What is your problem ?

    If this is one of your first games, I would suggest you take a look at this first tutorial before going into something like this.

    You should also try to provide a .capx if you are not sure of what is not working :)

  • Random gives you a float, not an integer. You need to use "floor(random(6))" and it will work.

    In your particular case though, I would suggest you play sound from string, not from file, letting you construct the name of the music, something like Play "fid_"&MusicPlay, as all your music (except the first index) has a name of this type.

  • The System function "find" is here for you. It helps you find the index where your specific word starts in the text passed in argument, and returns -1 if it's not present.

    From the Manual :

    find(src, text)

    Find the first index within src that text occurs, else returns -1.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I can't, sorry. But here are the screenshots :

    EventSheet :

    <img src="https://photos-4.dropbox.com/t/0/AAAasQUEh9UtlEppNn7cieTrMrGuKbKb4VZrXncgf6HNGg/12/113235847/jpeg/1024x768/3/1372258800/0/2/sinPin1.jpg/4wddSfo64HH7COhVQoAnHvB8qIqlZig8R_SCHr_qy1k" border="0" />

    Layout and Ship Sine behavior :

    <img src="https://photos-4.dropbox.com/t/0/AAA-p1jT7KQA4GjLAgBt0rdeB2vKd4jmzZlB8bHqNhz6JA/12/113235847/jpeg/1024x768/3/1372258800/0/2/sinPin2.jpg/P6rv8B9YO5GpeLqiJ3NQbUwGY7MzjNo4Fo8O8sTgkD0" border="0" />

    Bar Sine Behavior (to simulate how you constantly change the bar height)

    <img src="https://photos-3.dropbox.com/t/0/AADEa1PQMDsPmH_80_2x6hAsWuE-0Svdwp7y10F-cY9EVQ/12/113235847/jpeg/1024x768/3/1372258800/0/2/sinPin3.jpg/5axC6DqBeQ7QDP22et6EmZYFGYGjNPYohYcEQlH9mkQ" border="0" />

    Initialy, I put the bar and the ship on the same coordonates, I separated them to be clearer here.

    The ship is 100px orange, and 50px blue, just to check the bar height : the bar being 50px height with a magnitude of +/-50px, it should go from 0px height to covering exactly all the orange if the scalling is right.

    The width of the 2 objects were the same for me, just to check the scalling too, but you can change base width with no problems.

  • Sorry, I'm not at home and don't have a controller to test it and debug it here. I'll try to come back to you on the subject tonight.

    If anyone has another idea on how to map this DPad, it's welcome ^^

  • Not being an artist, I can't be of a great help for most of this. What I can do is give you this tool I use for sound effects like power ups, shooting, explosions, ...

    It's a flash App with some randomised presets, lots of sliders to mutate the current sound, and importer/exporter to wav and mp3. It's dedicated for 8/16bits sounds, but for simple SFX it's useful.

    I hope it's of some help !

  • Well, last try ? I put up an HTML page executing exactly the code I linked you before, the test is still the same : once the page is open, plug in the controller.

    It's not exactly the same code as in the plugin. The plugin checks lots of thinks, like what browser it is, what gamepad, if it knows how to map it, ... (witch could explain that the sample capx didn't trigger anything, if C2 ignores unknown gamepads). The function I used is only here to tell if your controller is usable by the browser, if it's detected when plugged in.

  • Ok, so this was harder than I thought ^^

    I managed to get it work though : capx

    I had to create 2 variables though, baseWidth for the ship and the bar. It should be possible to get the current scale of the ship from the behavior, but I only get the curent value (going from -magnitude to +magnitude) and I have no idea how it is then used in the sin behavior to change the size of the ship... With a magnitude of 50, I thought my sprite was going from +50% to -50% size, but it didn't seem to be consistant with the rest...

    Well, by storing the initial values of the ship, it is possible to deduce the current scale, and apply it to your bar. You will have to add the shipScale (=curentWidth/baseWidth) in the function that sets the bar height though. In my exemple, I used a sine behavior on the bar too, set to "value only", and handled the changing size in the events.

    Fell free to ask if something is not clear !

  • Sorry, you have to enter this in the Javascript console. On chrome, F12 will make the debugger show up, and there is a tab "Console" in it. There, just enter the code I gave you, and submit it (enter). Then, plug in your controler. If it's detected (i.e. if the browser gets a hand on it and gives it to your page), there will be an alert and some debug in the console.

    If not, you will have to use third party software as javascript would then be unable to access the controller at all.

Guizmus's avatar

Guizmus

Member since 26 Mar, 2013

None one is following Guizmus yet!

Trophy Case

  • 11-Year Club
  • x4
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

15/44
How to earn trophies