DaveSilver's Recent Forum Activity

  • Okay so I am reviving this question because I would like more clarity on what ramones said. What is the relevance of me creating the Blocks in the same Event as the one in which I call the Function? I have been working on a better version of the game I was originally working on which handles much of the code more efficiently and I find that since I don't really understand what the problem was to begin with, I can't actually create a better solution for it. I know that the issue can't be as simple as not being able to edit an object in the same event you create it since I do that all the time. If anyone could explain to me why ramones made his original comment, it would be a huge help. If you still need the code I can attach it, but I don't see a reason to since ramones' comment was made without knowledge of how the code was structured before, and I am really just looking for clarification on that. Also, how would I tag ramones so that he himself could see this post and hopefully chime in?

    Thanks for any help you can provide.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Okay, I finally got it working. Ramones was correct, it was having an issue because I was trying to call the function which caused the for loop in the same event which created the blocks. I had to use a somewhat stupid workaround to fix it, but now that I understand the reason for the issue and got it fixed, I should be able to spend some time thinking of a more elegant solution. Thanks for the help.

  • Hey everyone, so I am having an issue I was hoping some of you may be able to help explain to me. I created a function in my project. Inside the function, there is a For Each Object Loop which goes through every instance of the object type I'm looking at and runs some code. The problem I am having is that when I run the game the For Loop only fires 1 time if it is part of the Function call. If I take the For Loop out of the function call entirely and make it a separate event it works perfectly and does exactly what I need it to do other than the fact it is running at all times and not just when I use the function. However, once I re-insert the function into the For Each Loop the problem reappears. Does anyone know why this might be happening? For reference I have included some screenshots of the function so you can get a better idea of what I'm saying.

    <img src="http://i.imgur.com/naL2sXx.png" border="0" />

    <img src="http://i.imgur.com/DitGAFU.png" border="0" />

    <img src="http://i.imgur.com/n6w7A7S.png" border="0" />

    Any help on this would be really appreciated as I think I had this issue with other functions in previous projects and Ive never been able to make it work. Is there something about the way a For Each Loop works inside of a function that I need to be aware of, or is it something else entirely?

    Anyway, thanks for any help you canprovide.

  • Hey everyone.

    I am trying not make a relatively simple game and all of the game-play is working fine so far but I keep having a weird issue with the sprites. I think the issue is because I'm working from a machine without a dedicated graphics card so it's incapable of handling the graphics but i thought I would post here and see if anyone could verify that as the issue or tell me the real issue. So when i start the game the graphics look fine...

    <img src="http://i.imgur.com/r0deMH3.png" border="0" />

    but after a random amount of time all the images will switch to this...

    <img src="http://i.imgur.com/AsSvg4q.png" border="0" />

    Is this in-fact a graphics card issue or is it something else? Any help would be appreciated.

  • Sorry, I was wrong. This actually did resolve the issue. I ended up spacing the blocks more and now they work perfectly. I also realized I wasn't redrawing soon enough and thus it was accurate but was a delayed action. Thanks for the help.

  • I've determined this cannot be the issue because I made it so that they spawn 6 pixels away from each other and it still does everything the same way it did before.Thanks for the advice though.

  • Hey, so I am having an issue with a project I'm working on. I'm trying to make a puzzle game and I want to use collision detection to determine when blocks should fall. Right now I have my project setup so it automatically creates an entire game field worth of blocks just so I can test basic mechanics and get things working.

    The issue I am running into is with the Event "Overlapping at Offset". Basically, every time a block is destroyed I start a sub-event which looks at all of the remaining blocks and tests them against the space below them. If the space is empty, it is supposed to cause the block in question to drop down into the empty space. Currently for simplicity I just have it changing an instance variable that is associated with the block. The problem is that for some reason it always detects a block, even when there isn't one there any longer. The only scenario where it is working and is not changing the state of the instance variable is for the blocks on the bottom row.

    I think there is an issue that the blocks are not actually being eliminated from the game fully, so when it checks they are still technically there even though they aren't showing up. This makes sense with the fact that the bottom row of blocks has no issue since there were never blocks below the bottom row.

    I am removing my blocks with the Destroy action and davesilvermanart.com/Chromathud.capx is a link to the current version of my project in-case you want to look it over to try and understand what I'm saying better.

    Basically my question is, does the destroy command eliminate an object entirely and prevent it from affecting collisions? If so, why might this be happening?

    Also, the way I currently have things setup the blocks are 44x44 pixels and the origin is in the center of the box. When I perform the check to see if there is a block below the one I'm looking at I have to look 45+ pixels below the block to make the bottom row work, but since my origin is in the center of the block, shouldn't I only have to look 23+ pixels below since 22 is half of 44?

    If anyone can help I would greatly appreciate it.

    PS: in-case you downloaded the game, the idea of the game is to add up blocks to equal the target. You select blocks with left-click, deselect with right-click, and blocks don't have to be touching to be used together.

DaveSilver's avatar

DaveSilver

Member since 24 Feb, 2013

None one is following DaveSilver yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies