dhunHERO's Recent Forum Activity

  • Like Fengist said, it's hard to guess the problem without a code to check. But, it may be that you are asigning string values instead of numbers when trying to set the colors. If each array is a string, like "123,45,98", you must, first convert those to numbers using int(value).

    For instance if you have "123,45,98" as a value.

    Instead of using "set color" to

    rgbEx(array.At(x,y))

    You must get each of those and convert to integer. Something like this

    rgbEx(tokenat(array.At(x,y), 0, ","),tokenat(array.At(x,y), 2, ","),tokenat(array.At(x,y), 2, ","))

    Maybe the problem has nothing to do with this, but it's a guess since I have no access to you code.

    Cheers!

    Thanks for letting me know on the tokenat expression! That makes things much easier, I figured out what to do! And, I am sort of new to the forums in terms of asking for help, so I will keep in mind that I need to share my code. Thanks again!

  • Hi! So, I'm making a game that's basically like flipnote studio. An animation tool. But beefed up and is real cool. So, the game works by generating pixels on a 1080x1080 area in the center, generating pixels of 108x108 area. My plan is to have the pixels reference off of a 108x108 array for its color, and the user can write to that array, and the pixels will re-render the canvas to show the changes. That's the basics of the drawing mechanic. The X and Y axes will be the pixels' color, and the Z axis will indicate the different frames. It starts by just going to 0,0 and cloning pixels across the area.

    Even though I haven't found a reliable way to render the canvas real quickly, the main thing I want to stress on is how the pixels will change color? If I manually enter something to get a diagonal gradient (for example, the color "blue" will change based on what X and Y value it is. The more they are, the stronger blue it will be) and it works! But no matter how hard I try, everything is always black when I try to read values off of the array. All the values are set to be like "000,000,000" and some are set to "1000,000,000" but nothing happens. Not even when I changed the array to a simple "0" to indicate black and white instead of color.

    Can anyone help me on how I can read color from an array and apply it on the respective pixel? Let me know if something is unclear or not mentioned. Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • My idea is pretty crazy, but there it is:

    Say you have a 64x64 pixel canvas,

    Each pixel could be assigned to a value in an array (X is pixel's X coord, Y is pixel's Y coord)

    for each XY value, you have something in the format of "255,255,255", a RGB value for each pixel (you can pick individual pieces of this value using the left, mid and right expressions).

    Now, the Z axis is the frame of animation, iif you want to work with animations. So, the Z axis would store a different RGB value for each pixel for each frame.

    Now, for the drawing detection:

    First, create global variables that store the current frame (i'm calling canvas_curframe(num)) and the selected brush color in RGB (i'm calling canvas_brushrgb(string)).

    To select a color from a menu, you can do something like

    - If color selected is RED -> set canvas_brushrgb as "255,0,0" -

    To register where the user draws the colors on the canvas, you can compare the cursor's X and Y coords and assign them to a grid.

    - On Mouse Left click hold (or whatever) -> Array set at X = mouse.x, Y = mouse.y, Z = canvas_curframe, value = canvas_brushrgb

    Finally, the last step is showing the actual pixels on screen via the canvas renderer an that's the one part I can't help you because I never used the Canvas external plugin, but it gives you options like drawing lines, points and boxes directly, wich you could then save as canvas snapshots and turn into frames. Just google "Construct 2 canvas plugin" and you should find info on it.

    Hi, thanks for the info!

    The only thing I'm slightly confused on is the renderer and how to set the pixels in the right place, and how to manipulate them, but I believe using simple maths will suffice.

    As for the canvas plugin, I had considered that before, but i found some difficulties working with it and using pixels give much more charm and ease of use, especially with arrays.

    For now, I'll just work on the renderer, but thanks a bunch for your help!

  • I'm looking to make a flipnote studio-like game where you can basically animate (albeit in a low resolution canvas) and add sound to your animations, and share it with a community.

    How do I make a "canvas renderer"?

    For example, the canvas isn't high resolution, you can see the pixels. But, how do I write data to the pixels and display them, so that if I draw something in red, it will show up on the canvas? Basically, how to display what I draw, and how to draw at all?

    Let me know if this is too confusing to understand, so I can explain it better.

    Thanks!

  • I need Litetween in C3 runtime.

    https://www.construct.net/en/forum/extending-construct-2/addons-29/behavior-litetween-48240

    Me too, but I don't think that'll work for the runtime.

  • I would never understand why people create several fancy start screens and add 40+ megabytes of music and animations, before coding basic game mechanics. Doesn't it annoy you when you have to listen to the same music and go through the same screens hundreds of times every day?

    You could have at least removed all that unrelated stuff before posting it here, as a courtesy to those who are willing to help you.

    1. You are spawning targetspr in event #27 on every tick while 3 conditions are met. If you just want to spawn this sprite once, you can add another condition:

    targetspr.count=0

    2. Not sure which sound you are talking about. When I press Z, the "jump" sound is played immediately.

    1. ...........true.

    2. Thanks lol, fixed the problem after my fix.

    3. Eh, idc. It wasn't he jump sound though.

  • EDIT: Fixed lol.

    So, I built a homing attack for my sonic fangame, and there are 2 things that are wrong with it:

    1. The target image is appearing millions of times before an attack. This will take resources and interfere with the animation.

    2. When Sonic launches, there's supposed to be a sound. the sound plays AFTER the homing attack has completed.

    There is a range bug, but I'll fix that myself. Problem 2 isn't a huge deal, but I'll like a workaround. Problem 1 is a huge deal, because not only does it look bad on animations, but it may decrease performance.

    Please help. https://drive.google.com/file/d/15M06Mc ... sp=sharing

    Repost 'cause my previous thread wasn't noticed.

  • So, I built a homing attack for my sonic fangame, and there are 2 things that are wrong with it:

    1. The target image is appearing millions of times before an attack. This will take resources and interfere with the animation.

    2. When Sonic launches, there's supposed to be a sound. the sound plays AFTER the homing attack has completed.

    There is a range bug, but I'll fix that myself. Problem 2 isn't a huge deal, but I'll like a workaround. Problem 1 is a huge deal, because not only does it look bad on animations, but it may decrease performance.

    Please help. https://drive.google.com/file/d/15M06Mc ... sp=sharing

  • Create a parent event "Platform is on the floor" and move events 5-8 to it as sub-events.

    I actually admit I have no idea how sub-events work, so I would never have done that, so thanks, again..!

  • No problem!

    Where did you see that I changed the default animation to dash? I didn't.

    In the event sheet, the sonic skin sprite has the dash animation.

    Is that something you did?

  • I know, I posted again, late too, but can you help me?

    I fixed my Sonic movement in my game but the jump animation doesn't work. Please help me fix it...

    https://drive.google.com/file/d/15M06Mc ... sp=sharing

  • You are simulating controls only when the speed is <200

    Change your events like this:

    THANK YOU! You are a legend! I am a beginner, I should say that, but you really helped me! Thanks!

    Say, why did you change the default animation to dash? Just curious.

dhunHERO's avatar

dhunHERO

Member since 23 Aug, 2015

Twitter
dhunHERO has 2 followers

Connect with dhunHERO

Trophy Case

  • 9-Year Club
  • Email Verified

Progress

10/44
How to earn trophies