EpicRaid's Recent Forum Activity

  • 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?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • Yeah it wouldn't be hard to implement. But did you manage to customize the close button out of the tabs though? I was aware of the right click menu. Nice!

  • sharpysharps86 Yeah I asked because the amount of detail is just incredible. Must take you hours and hours of time to create. I admire that kind of patience and dedication.

  • Hi all,

    First post on the forums. I've been working on a Doctor Who point and click inspired adventure game / fan project to try and get to grips with Construct. Some screenshots below:

    sharpysharps86 I'm not really into point and click nor am I familiar with the Dr Who game, but the graphics of those screenshots are incredible. Did you create those yourself?

  • I think the tabs are useful though, but the X's in the corners need to go. Maybe just have us right click them and select 'Close' or something.

    I think only having the project bar is not a good way to go. Since you'll be scrolling up and down all the time since there are many other objects there, even if they're inside folders. Plus you need to double click them (currently) every time you want to access them.

    It doesn't need to be redone if you ask me, just the X in the corners of the tab could go. Or at the very least be hidden unless the tab is active, that'd also help.

    I think we could use a set of options to choose from, it could be as simple as be added in the Settings; 'Right click to close tabs', and for you 'Don't show tabs'.

  • Those tabs are so small, I often accidentally close one of them and have to re-open them from the project bar an re-arrange it back to its original spot. Is there any way I can prevent this, e.g. by 'locking' the tabs so I can't click them away?

    Of course I could use longer names for layouts and event sheets, but I really am looking for a solid solution for this.

    I can't be the only one who finds this annoying?

    Thanks!

    Tagged:

  • Biscotto Thanks for your reply. I couldn't find anything either. Maybe it will be added some day.

    Yeah I thought about spritefonts, editing the basic fonts seemed less of a hassle. Oh well, might as well get a fancy font now anyway since I got to use spritefonts! :)

    Thanks!

EpicRaid's avatar

EpicRaid

Member since 13 Feb, 2015

Twitter
EpicRaid has 17 followers

Trophy Case

  • 9-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

18/44
How to earn trophies