EpicRaid's Forum Posts

  • That'd be awesome. Can't wait! Thanks in advance.

  • Thanks for your reply.

    If I wanted to change the code so that the cars only turn right, (so they circle a block, or possibly around four blocks) what would I need to change? I intend to use it for enemy cars, so they won't Wrap, and the enemy cars will drive around a block on the map.

    I also want to use the same code so that cars only go straight ahead (This one does use the Wrap behavior) and will give way to cars coming from the right. This code will be used for all other, regular traffic then.

    What would I need to change?

  • Anyone?

    I tried adding and changing parts of the code in the link (you can still open the .capx in C3 ;)) but after hours of fiddling I gave up. I was hoping someone with more knowledge could help out!

  • Maybe it's trying to connect to (by default) an incognito window in Chrome. Otherwise, check the browser settings of Chrome, maybe it does clear the cookies/cache automatically.

  • Hey all!

    I found an 'old' car traffic example by R0J0hound;

    construct.net/out

    Which I'm really grateful for!

    But I noticed, as well as by reading an old topic of mine where the link was posted, that it wasn't completely finished.

    Main problem is that there is congestion at the junction, when too many cars want to go in different directions. Problem: They get stuck. They do move tiny bits, but through eachother. I'd love to see it solved, I'm sure many others would get great value from this.

    So what I was thinking is, if there are three or more cars entering the junction, and they are all waiting for eachother (and the code 'knows' this in advance) have a car take another turn, instead of the turn that would cause trouble between the cars at the junction.

    I couldn't figure out what lines to adapt/add and where, partly because I don't understand what everything 'does'.

    P.S. I posted this in C3 section because I used the code in a C3 project.

    Tagged:

  • OK, so if I insert a sprite, with the car facing right, and rotate it 90 degrees then the cone of view would turn 90 degrees along with it? What do you mean by tight though? That the events are programmed in a specific way?

  • I'm trying to create a traffic system where cars stop when they see another.

    So if you have a 4-way junction, and you use LoS, the car seems to only check it from one direction. In this case, using 360 cone is not an option.

    Is there a way to set which angle the cone of view must check? or an alternative to LoS? It seems to be 'default' to 0.

    So when you copy-paste the cars and set their angle to 0, 90, 180, and 270 for all traffic directions, some cars 'see' the other cars in time but others don't. I assume it has to do with the cone.

    Also, if the latter is solvable, is there a more simple way to get the cars moving again once they stop? I mean in the proper order of course.

    I thought this was easy to set up, but now it's giving me a headache, so to speak.

  • Thanks, I think it works though as I put the objects seperately in the container. And they are linked. I replaced and cut down a lot of lines of code, but still a lot of quirky things are happening. Not sure how to fix them. But on the upside, I learned a lot of new stuff like how to code more efficiently. I can't imagine ever doing that treadmill work again which I did a week ago, lol, so inefficient and time consuming.

    P.S. Maybe a bit of a personal question, you mentioned you are currently not subbed, are you not (interested in) making games anymore? Or are you perhaps using another editor, like Unity etc.? Sometimes I take a long break myself, but I always seem to come back, when thing work out it can be a lot of fun to make games.

  • Hey, thanks.

    I significantly reduced the number of variables.

    I believe it is also possible to 'link' the objects if they are in the same container, correct?

  • Hi there!

    I'm running into a problem - which I've come across multiple times before - but still am unsure how to 'solve'.

    I was working on a basic economy game where you can buy up to 10 flats, and charge rent for the number of floors, there are 5 floors. I also implemented a mechanic where renters would occasionally, randomly leave an apartment/floor and you'd have to click a button to rent it out again to get rent.

    There are also repairs involved, which start adding up when you purchase the building. Repairing costs money. If you don't repair, the renters start paying less money every x seconds until a minimum rent is reached. Finally, you can collect the rent. If you click on a building you get a menu with all the buttons and rent height, repair height and total rent height displayed, with a close button to close it for that building.

    There are also visual signs for each building to warn you when can collect rent, repairs are overdue etc.

    So you have building 1, 2, 3 etc. up until 10 (this image is just to give you an idea, didn't want to put the whole artwork here)

    Problem: The code works perfectly for one building. But the challenge lies in efficiently reproducing the code for all the 10 buildings which all do the same thing. Earlier I thought to myself; why not copy the code and buttons for each building? But that turned out to be a hellish amount of mindkilling work, duplicating each button, global variable, and replacing everything in the code.

    I figured it could be done more efficiently. So I started using instance variables for buttons. That reduced the amount of work largely, but I still found myself replacing and setting code for each specific building and its floors. My god.. and all kinds of quirky undesireable stuff is currently happening. In other words - it's not working and I was about to throw in the towel.

    I'm not so sure what I am doing anymore, where to look for in the code to fix it, and I'm confident there's a way more efficient way of coding this. Here are some examples of how it looks now:

    It would be awesome if someone could point me in the right way of how to handle this. Currently I've got about a 165 global variables, well, let's just say I firmly believe it can be done more efficiently, just don't know how.

    I thank you much in advance!

  • You do not have permission to view this post

  • You do not have permission to view this post

  • GloryF90 I can see you put effort in the game. Good job on that part. Although I'm not really fond of the graphics. It looks a bit cheap. Try using a non-standard font as well (so not Arial, Times New Roman etc.) so it looks a bit more professional.

    Also.. shouldn't it be 'Get off my property'? Instead of 'Get out of my property'? I also noticed Spanish words in your game while the game is presented in English.

    Best of luck!

  • You have to swipe in from the side a few times

    Isn't that a standard swipe already used to go back and forth in your browser? Or is there a handle that allows you to swipe it in?

  • psychoanima winkr7 I tried it on my Android 10", but I find it a bit hard to change anything without a mouse. I do have a keyboard for my tablet. You could buy one of those tablet cases that come with a keyboard, which connect to the tablet with Bluetooth for example.

    I did buy a small USB-C mouse (fits in the charger port of the tablet) and a small mousemat for it but haven't tested with that setup yet. I really only program on PC. Much larger screen, bigger and faster everything!

    But in the sense of portability, a tablet case with keyboard and a mouse, or even a wireless pen mouse (a pen mouse can make use of almost any small surface) could do the trick for you.

    I did notice you can't really do much in the layout editor though, the side bars are missing or are they accessed elsewhere? It's kinda crucial to be able to check instance variables and object properties when programming.