Multi-Resolution Game Development With GameBuilder Studio Check it out!
NEW Version 0.9.7 has arrived! New Blazing Fast Particle Engine & More Game Actions. Check it out
Few noob questions
  • Hello!

    I´ve been playing around with GameBuilder for a while now, and i´m really liking it.
    Couple of questions though...

    1. I´ve used Gamesalad for few years, and there´s a behavior called "accelerate". Is there something like this in GameBuilder?
    I need something like this to have a custom gravity point in my game. It would also be helpful in many other situations. The only thing i´ve found is "change velocity", but that does not work like gravity.

    2. Is there a way to add rows to a list with a rule? For example: If touch is down -> add row to a list.

    3. If i use "If mouse is down" in a rule, does that register as a touch in a mobile device?

    Thanks for the help in advance!
  • 3 Comments sorted by
  • @MentalDonkeyGames thanks for giving GameBuilder Studio a try.

    1. When you say accelerate I believe you are speaking of moving an object in a certain direction. In GBs you can use the Move or Move Toward action if you know which object you want to move toward.

    2. To manipulate a ListData component and add entries to it just use the List action. It has all of the different options you need to add, remove, and replace values at runtime.

    3. Yes
  • @Lavon Thanks for your reply!

    With accelerate i mean a way to move an object with an increasing speed. Like a car for example.

    With the list thing i meant that if i have a list that has, for example, 5 rows in it, is there a way i can add a row to it at runtime so it has 6 rows? Does it do it automatically if i just add a value to row #6?
  • @MentalDonkeyGames 

    If you want to apply constant acceleration to an object you can create a custom property on an entity using the Data Component. Call it "currentSpeed". Then use a Rules Component with a Mouse Down condition and add a Change Property action to increase that value by an increment amount of whatever (+5). You will have to do this by writing an expression (i.e. Self.PropertyComponent.currentSpeed + 5). Add a Change Velocity action right after the change property action and pass that "currentSpeed" property in the ChangeVelocity action speed input.

    That will constantly increase the speed of an object every time the player mouses down. If you want the acceleration to just keep increasing while the game is running remove the condition and use a Timer action ( to create an interval) or a Constrain Property action to constantly execute the increase of the "currentSpeed" property and the Change Velocity action will constantly read in the new value every frame of the game. If you have global gravity on there will be a natural deceleration applied after the velocity has been set. You can also turn off gravity and manually control deceleration by using another Constrain Property to constantly decrease the linearVelocity property on the Spatial being moved. There is multiple ways to go about this. It is up to you and what you are trying to do.

    Regarding the list, yes you can add a six row by using the Change List action and changing the action type to Insert Into List to add an value to a certain position in the list or use the Push Onto End Of LIst action type to add a new row with a value to the end of the list. So your LIst would start with 5 rows and when you execute this action it will then have 6. You can always add these rows with dummy value of 0 and then change the value of that particular row to whatever you want during runtime as long as you know the row index you want to change. Keep in mind the row index is 0 based. So row 1 is index 0, row 2 is index 1, etc...

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion