PhoenixNightly's Forum Posts

  • Here an example of what i evented togther running-

    Detecting Occupancy

    HERE IS THE EVENT SETUP

    Setting the boolean instance variable for checking--

    In the event sheet a while loop was created to look until a spawner instance variable for occupy was 'false' and once it placed something there is switched it to say something was there. When the object destroyed itself it re-selected the spawner that created it cause it was overlapping and change the Boolean for occupy variable back to 'false'.

    I can only assume that this is what you want couldn't open you capx... guess you have the beta version installed. But if so you can look over this.

    A few areas can be fixed for redundancy but 'Families' would make it more cleaner.

  • This was a great question with fantastic answers!! When I saw the dummy layout option I was like 'DUUUUH' something so much better. Will add it to my development practice!!

  • I added ChartBoost. Not Admob...yet. The only thing I see when I run my app in CocoonJS Launcher is that I messed up on the ad refresh. But it shows a Banner ad.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes you need premium I will test it out. I just got approved.

  • Use the 'else' so it don't have to process unnecessary tests. So if the frame =0 it won't execute the other comparisons and skip over them.

    Might have to use the 'for each' loop

  • It would be

    "The variable is: "&varX

  • Can't answer that at the moment cause I haven't done it. but I am planning to package something soon and have been trying to see if I can integrate Amazon or Chartboost which would probably require me to go through eclipse to do.

  • Updated the events a little more. This uses 'Families' so I don't have to setup the same event for each object that has sound. Also make it that when a object triggers the sound to make it so that another object that may have the same file to make each object sound tag unique I used their UID in the naming of the sound.

    You can see the changes here-http://bit.ly/1fOoXrp

    Use the arrow keys to move the purple box.

    ::SCENE LAYOUT::

    ::EVENT CHANGES::

    If you don't have a license for every object that you wanted to do something like this you would have to set up the event individually or use frames...but then code each soundfile for each frame. Which does become unreadable to an extent and make a higher possibility of errors.

  • Make an event for object playercar and it will say is 'boolean instance set' this will return true or false so create an else for this event in case its not set

  • What you do first is check if the carPlayer isDriven is set to true of false. Then execute the keys function you need.

    So

    carPlayer isDriving=True then key do this

    else key do that.

  • Sorry for the late post took a moment to type everything up ::

    What you can do is have two objects PlayerCar and Player. For the PlayerCar object you can have a variable boolean instance called 'isDriving' if you player starts out outside of the car then you can set that to 'FALSE' by default. Then if you are using the 8 Direction for control give the car that behavior but again if the Player starts outside of the car set it to 'DISABLED'. Now on you player object create the 8 direction and Pin behavior.

    Now in the event sheet you can have when the player is overlapping the PlayerCar and hit whatever key it is to enter the car set the action to 1) Hide the player 2) Pin player to the car 3) set its 8 direction behavior to 'DISABLED' 4)set the car isDriving to 'True' 5)enable 8 Direction. So now where ever the car move to the Player object would follow invisibly.

    When they exit the car 1)set car to isDriving 'False' 2)Disable PlayerCar 8 Direction 3) set Player Visible 4)Unpin Player from PlayerCar 5)Set Player 8Direction to 'ENABLED'.

    Is another way of doing it. The isDriving boolean can be used in case certain keys match when the player is on foot. So the key would know which to do depending on if isDriving is set to true.

  • Sorry for the late response back. But there is a event that compare the frame of the object and only the instance(s) that it is true for would trigger the event. So if you did:: Lets say you sprite name is 'Puzzle'.

    If you set a event that says Puzzle compare animation frame=1 then any puzzle instance who frame is one would enter this event and run whatever actions you need.

  • First view this to see what the results would be-https://dl.dropboxusercontent.com/u/128026415/SoundTest/index.html

    Move with the arrow keys

    **Note disregard the toggle button doesn't function***

    WHAT IS HAPPENING?

    What I did was setup a soundRange that follows the player where ever they go and each level triggers the sound for that object. Green for low level sound Yellow for Mid level sound and Red for full sound. (Which you can see in the top image below)

    IMPLEMENTATION

    Now for the soundLevels I set a instance variable called soundRange to tell what level to play the sound at. for the object 'Fire' it has two variable instance 'soundFile'-for the audio file that needs to be played and 'inRange'-which is triggered when they enter the Green Zone. When object exits it zeros it out and stops the tagged sound.

    I did it this way cause I notice from your profile you don't have a license. So look at how my events is setup below and try to implement it yourself. Also I did test it on my android in Cocoonjs and it did work for me.

    But if you have more items for sound depending on range a license would be beneficial because you can use Families. Which is nice cause you can declare the instance variable in that and it would be transferred to whatever objects is in the family and you can set each object as you please.

    With Families it would look like this::

    So any object in soundItems would be tested.

    **UPDATE**Just pin each range to the playerSprite is better.

  • First thing first set this up in your project first and we will take baby steps to what your trying to get to.

  • ?? The set motion angle goes by whatever angle you need it to go and give it. So you would have to calculate the angle you need by calculating the position of the player.

    Sorry not at my computer on campus. But to illustrate how the set bullet motion angles work. Kinda...[attachment=0:3oeo2xy9][/attachment:3oeo2xy9]