tulamide's Recent Forum Activity

  • I admit, I'm not familiar with the term "double tap", so I had a look at wikipedia, which stated that it is something like a rapid double shot.

    If it is meant to trigger once but shoot twice within a certain timespan, than you can do it this way:

    var 'double' - 0 for single shot, 1 for double

    var 'time' - timespan between first and second shot in milliseconds

    var 'timestamp' - (make this a private var to the bullet object, initially 0) the moment when the first shot is activated

    + some condition that activates double shot

    -> 'double' = 1

    + key for shooting pressed

    -> spawn bullet

    ++ if 'double' == 1

    --> bullet('timestamp') = timer

    + bullet('timestamp') > 0

    ++ bullet('timestamp') <= timer - 'time'

    --> spawn bullet

    # not from this bullet but from the player!

    If this isn't what you're looking for, please ignore or explain in detail

  • Using XAudio2 isn't as complicated as it is stated.

    XAudio uses 2 independant architectures, distinguished by the keywords 'sound' and 'music'.

    'music' is used to play a file (either from disk or resource). The file format should preferably be mp3, but wav and wma are also playable. It is only playing one file at a time, doesn't know about channels and hasn't much options to alter anything while playing.

    'sound' is a bunch of sound channels that can be played simultaneously, with many options to change the behavior of audio while playing. Preferable sound format is ogg vorbis, but wav is also supported. It is used by loading a sound file to a channel (binding it to that channel) and from there on give orders to the channel (not the sound). As soon as a sound file on a channel is fully played (which never happens if the channel is looped, or the position always set to somewhere before the end of the sound) it is released from the channel and any try to play it again will produce nothing but silence.

    In your example you mixed both architectures, and that might have caused your problems. To play a sound loaded to a channel, you don't use the action 'play music' but 'play channel':

    + System: Start of layout

    -> XAudio2: Load resource "Skillet - Hero (instrumental).wav" to channel 1 (Loop)

    -> XAudio2: Play channel 1

    or

    + System: Start of layout

    -> XAudio2: Play music from resource "Skillet - Hero (instrumental).wav"

    If you decide to use the first way, then channel 1 is bound to "Skillet - Hero (instrumental).wav", if you later on load another sound to the same channel, it replaces "Skillet - Hero (instrumental).wav". To avoid that, use another channel:

    + System: Start of layout

    -> XAudio2: Load resource "Skillet - Hero (instrumental).wav" to channel 1 (Loop)

    -> XAudio2: Play channel 1

    + MouseKeyboard: On key Space pressed

    -> System: Create object Bullet on layer 1 at (0, 0) from Hero 's image point 1

    -> XAudio2: Load resource "imphenzia_soundtrack_laser36.wav" to channel 2 (No loop)

    -> XAudio2: Play channel 2

    As you can see it isn't very complicated, if you just keep in mind what architecture you are using, and how it is intended to work.

    EDIT: Made a mistake.

  • It might get boring that I point to my example Verve! all the time. But I really made it to cover as much as possible to show ways to realize things. Of course, Verve! also features a hiscore, complete with sorting algorithm and auto-save. Have a look at it, every single event in Verve! is extensively commented.

    For the timer, you could also use the system expression timer and a timestamp. timer returns the time passed since start of the game in milliseconds.

    + start of layout

    -> set 'timestamp' to timer

    -> set 'maxTime' to [somevalue]

    + always

    -> set 'remaining' to 'maxTime' - (timer - 'timestamp')

    -> set text to int('remaining')

    + 'remaining' <= 0

    -> game over

    The third point is one possible way to do it, but the 'every 10 milliseconds' doesn't make much sense. When running your game v-synced it might be played at 60 fps, that's 16.67ms. You could also reduce Time vs Score with TimeDelta:

    (50 * TimeDelta would mean substracting 50 points per second. If the game runs at 60 fps, it will substract 0.834 per tick. At 25 fps it would be 2 per tick. Overall 50 per second)

    + 'remaining' >= 50 * TimeDelta

    -> Substract 50 * TimeDelta from 'remaining'

    -> Add 50 * TimeDelta to 'score'

    -> set text to int('score')

    + else

    -> level complete

    EDIT: It was late yesterday and I'm giving the examples without using Construct. I made one mistake, in my example 'maxTime' would have to be a value expressed in milliseconds. You surely don't want that, so just change

    -> set 'remaining' to 'maxTime' - (timer - 'timestamp')

    to

    -> set 'remaining' to 'maxTime' - ((timer - 'timestamp') / 1000)

    Now 'maxTime' can be a value expressed in seconds.

  • So, here we go again. After Nintendo, Sony and a few more, this time Sega was the victim, and the hackers stole informations about 1.3 million customers...

    http://www.cityam.com/news-and-analysis ... ack-attack

    It's kind of funny, because those firms now suffer from something they provoked themselves, when insisting on online user profiles. Anyone know of the good old times, where you just bought a game in a store, then installed it and never had to give any information?

    Steam next?

  • I worked with Blender for a while. It's true, you can get results and have a quite good workflow - but the UI is more of a power-user-friendly interface than anything else. I felt it being terribly un-intuitive, even more if compared to C4D or Maya, etc.

    Sculptris can't be compared to it, because it is very limited. On the other hand it has a very intuitive interface.

    Can't check Autodesk 123D, but will asap.

  • As always, the best recommendation is Silent Cacophony's Python Shell:

    http://www.scirra.com/forum/viewtopic.php?f=8&t=6158&p=50287

  • Yes, as Arima said. For something like a growing or shrinking bar I would advise using the panel object or the tiled background object.

    An example of the panel object use for a health bar can be found in Verve! (I give this link, because it definitely works with your version)

  • Yes, that's why I said, that it only makes sense against other cars

    It is just a start, you would have to further split the events by adding sub-events, to catch all possible situations, e.g.

    + car's speed is negative

    -> set a variable to -1

    + else

    -> set a variable to 1

    + on bounce

    ++ colliding with another car

    --> Set speed as mentioned

    ++ else

    +++ variable is -1

    ---> do what is needed if the car hits anything but a car, while driving backward

    +++ else

    ---> do what is needed if the car hits anything but a car, while driving forward

    It should be doable. But, of course, you can always try to do it with custom behavior. It's just, that you don't need to completely redo the car behavior, just those on bounce situations, and therefore events are the easier solution with less overhead.

  • http://www.scirra.com/forum/viewtopic.php?f=8&t=8400

    Further down on that page you will find a cap, that accesses a 2D-array, writing and reading. Compare it with your array usage, maybe it helps.

    Also, Verve! features its own sort algorithm, realized with 4 arrays, accessing them reading, writing and resizing.

    Good luck

  • I would love to give you an exact example, but I don't have a pc to work with Construct for quite a while.

    But you really don't need another behavior, just use events that take over control as soon as the car behavior needs tweaks.

    Your idea is what I would do, too. Adjusting the speed, via 'Set speed'. Do it over time (n * TimeDelta). And keep in mind, that when bouncing, all values are expressed negative. If you don't want the car to go backwards, but rather slow down against zero, just reverse 'Get Speed' with abs() in the 'on bounce'-event.

    + On bounce

    -> car: Set speed to Abs(expression for get speed) - n * TimeDelta

    n being pixels per second, e.g. 'Get deceleration'

    This would decelerate linear and only when bouncing, making sense only when hitting another car for several ticks. It's just a simple approach to point to the right direction. For more detail I would need to work with Construct. I'm sorry.

  • Unless you're using some 15 year old gfx card, I'd bet it's a driver problem, particularly if it isn't a Construct problem alone.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The car behavior is rather limited in the points you mentioned. But there's a trigger, 'on bounce', it will be triggered once, exactly after a collision. I used it to get rid of bouncing, by using the action 'stop', in Verve!.

    You could use the trigger to dampen the bouncing. Also, decceleration is quite possible.

    When the car drives backwards, the velocity is expressed negative. Just create a condition that checks for velocity < 0, and dampen the velocity in some way, e.g. velocity = velocity - velocity * TimeDelta, or whatever is to your likings.

tulamide's avatar

tulamide

Member since 11 Sep, 2009

Twitter
tulamide has 3 followers

Trophy Case

  • 15-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

17/44
How to earn trophies