EpicRaid's Forum Posts

  • Hi,

    Thanks so much. I've been looking at the example, but I don't understand how to make a car move. Do I still use the car behavior? If so, how do I 'integrate' it so the car responds to the controls?

    Also, how do you know all this.. may sound silly but did it take you long to be able to code this? I'm trying to get better at programming but some things some times seem above my head.

    Thanks.

  • Hello,

    My car game is almost finished, and I am currently using a thumbstick to drive the car around.

    The traffic is vertical only and the player needs to drive vertically.

    Of course, to overtake cars you need flexible controls.

    The thumbstick works, but I'm thinking it could be much better.

    Like use a thumbstick for steering, and seperate two buttons for accelerate and brake. Like on a gamepad.

    Now I tried modifying the thumbstick to just use left and right, but couldn't get it to work properly in conjunction with the accelerate and brake buttons. Somehow the acceleration and max speed were changed.

    I simply disabled the accelerate and brake for the thumbstick, and added two buttons for them instead.

    The mobile game I made has a portrait layout.

    This is the thumbstick example I'm using, created by LittleStain : https://www.dropbox.com/s/i1obxb4zg018119/ProjectThumbstick.capx

    If anyone has any suggestions, ideas, they're more than welcome.

  • Hi,

    Thanks very much.

    That demo looks really good.

    I tried implementing your example attached .capx in my file but I could not get that to work though. I tried exactly replicating your example to my file.

    The cars in my file would still keep overlapping, but your demo it all works fine.

    I managed to code something with a little extra coding and now the traffic works.

    I also disabled the Bullet behavior for the Player it's working now :)

    Now my cars use the wrap behavior, which works fine, except that the wrap behavior doesn't take into account that it should stop for other cars.

    You see, the car must first be fully out of the screen area, before it enters it from the bottom.

    So if I don't drive forward, the cars that are wrapping on the top, will bunch up on the bottom and overlap eachother. I guess I could add extra cars below the existing lanes and remove the wrap behavior, but I was wondering if wrap could still be used to save time and memory space.

    Any ideas?

    Regards

    EDIT: I think it can be done with adding 200px to the Y of the car that is overlapping. Or going to overlap. Tried some coding, but so far it's giving me weird results or the cars still bunch up.

  • Hey, thanks for replying!

    I implemented the code you provided, however, the PlayerCar also moves automatically since it belongs to a family with the bullet behavior.

    Is there anyway to exclude the behavior from the family for the PlayerCar? I also need to exclude the solid and wrap behavior then.

    Because the PlayerCar needs to stay player controlled.

    Regards

  • OK, so I tried something new:

    This works, but only if there isn't the same car behind eachother on a lane.

    Example:

    PlayerCar

    Car1

    Car2

    Car3

    Car4

    Car5

    Works fine.

    PlayerCar

    Car2

    Car2

    Car3

    Car4

    Car5

    If the PlayerCar stops at the second example, the second 'Car2' in the row will drive through the other Car2.

    That's the problematic thing with the code I posted above.

    I tried to minimize the code and brought it down to one PlayerCar and one Cars sprite. But the result is the same; if the same instance is put or spawned behind eachother, the bottom Cars sprite will drive through the other and simply not 'listen' to stop for the same Cars sprite. It will stop for the PlayerCar however.

    Thanks.

  • Hello,

    I tried inserting an uploaded image in a post, but it's not working.

    Am I doing something wrong? I'm trying to use the 'img' tags the old fashion and in various ways.

    Uploading an image to a post from the forum also doesn't work? It just shows an ID.

    Thanks.

  • Hello,

    I'm trying to make car traffic, but don't understand how to code something.

    I'm trying to make the cars 'interact' with eachother and the player car.

    See:

    The top pink car is the player car. The two cars below are 'CPU' cars. When I drive, the cars should too. But always maintain distance to the player, and to the other CPU cars.

    I've tried different things, but can't figure it out.

    See:

    The CPU cars are bullets and drive 50 speed automatically, except when they encounter another CPU or player car it should stop when anything in front of it is stopped too. The player car has car behavior.

    Also, the cars are all in one sprite, except the player car. So the appearance of the CPU cars are already randomly generated.

    Thanks.

    EDIT: How to I show the uploaded image to the forum?

  • I'm really sorry... but... the name should be "Shoot" and not "Shot" because "Shot" is past tense... Sorry!

    There's also a game on Steam called 'Pike and Shot', I guess he used 'Aim and Shot' because the name you suggest has already been taken/used.. a thousand times

  • Subscribe to Construct videos now

    Now THAT looks nice. How did you make the graphics? With which program?

    It looks like it was made in Unity, keep it up.

  • Hello.

    I've got one main project, where I am working on. Now, there's another project I created for testing.

    The test project runs just fine - this technique works as I want it to.

    However, after having copied the 'technique' to my main project, I noticed there is an unexpected result.

    This 'result' is that the bullets spawned by object 'Flak' don't head to the direction of the object B17. The bullet has a speed of 50. As soon as the object Flak is onscreen you can see it shoots to the top and slowly corrects to the direction of the B17.

    However.. when I set the speed of the Bullet fired by Flak (in my main project) higher to say, 200 speed then it will immediately fire to the center of the B17. When I set it to 100, it'll start by shooting to the right.

    And when I change the speed of the bullet down to 50 in the TEST project, it'll work just fine. Heck, I can set it to whatever I want and it will always head towards the center of the B17.

    I'm going nuts here. I've checked the imagepoints, I checked the pivot point directions, everything seems to be the same as in the test project. Well, except from a few additions like resizing etc. that I already tried disabling but still it wouldn't make any difference.

    Yet it doesn't work properly. What the hell is going on?

    So here's the code from the main project:

    And the test project:

    B17Flak.capx

    If anyone can figure this out..? I'd be really grateful!

    • R
  • Allright thanks, you meant removing the first line right? It's working without that line.

    Thanks again for helping me out!

  • Thanks blackhornet !

    Took me some time to adapt it to my own dimensions, but got it working in the end. Am I right that all sprites have to have the same height in order for this to work correctly?

    One thing though, I don't understand what the speed variable does. I mean, the bullet behavior is already there. Does it have to do with the 'every tick'? If I want the bullet speed to be 100, do I need to double the speed variable?

    Programming and logic aren't my best skills I guess.

    Thanks again.

    • R
  • Hi blackhornet,

    Thanks, well they are sprites at the moment so I am using that 'technique' to put the connecting sprite to follow after the other.

    I made the sprites so they can slide down in a loop (sprites have bullet). Now the loop works, it's just that those gaps appear.

    I initially put the trigger once there because otherwise the connecting sprite that is supposed to follow up will forever be placed at that Y position of 0, and never slide down. I'll check if it is still necessary now.

    Anyway, what did you mean by "Don't set them to 0, subtract your max value. IE: Field2 Subtract 1024"?

    How is the code supposed to look like? I don't understand what to change to what.

    Thanks!

    • R
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • roguecore

    I would personally still prefer a bit more elaborate instructions (with images). For example you could cover facts like being able to destroy spawn points or the fact about vibrations that attract enemies. But then again, I would understand you would leave that for the player to find out and let them experience it along the way.

  • Hello!

    I am using 4 reasonably large sprites (320x1024) and they are moving down vertically. Thought I put them down into chunks with the max supported sizes and all.

    Here's the code I use:

    Now, the problem is I get these white 1 high pixel gaps/lines between each sprite. So there's a gap and it's showing the white background.

    Anyone know what's causing this?

    Thanks!