Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - josriley

Pages: [1]
2
Support / Re: Odd results when setting a random color in code.
« on: March 03, 2013, 02:41:46 am »
Yeah, noticed that too. It looks like it takes a value over 1 as 1, so it doesn't affect it negatively, but I've fixed that as well. I think I was just confused since it shows it on a 1-255 scale in the Inspector.

3
Support / Re: Odd results when setting a random color in code.
« on: March 03, 2013, 01:20:21 am »
Looks like that's the case, in case anyone else has this problem. This code solves the issue:

sprite.color =new Color(
     (float)Random.Range(0,1000)*.001f,
     (float)Random.Range(0,1000)*.001f,
     (float)Random.Range(0,1000)*.001f,
     255);

4
Support / Re: Odd results when setting a random color in code.
« on: March 03, 2013, 01:16:45 am »
Actually, I read it wrong, its setting it (25500,25500,25500,255) if I set to (100,100,100,255). I'm guessing color is on a scale of 0-1?

5
Support / SOLVED: Odd results when setting a random color in code.
« on: March 03, 2013, 01:10:59 am »
I have this code in my Start() function, and want to completely randomize clothing colors for my sprites. For some reason this line of code sets the r,g,b values of my sprite to very high numbers (4 digit numbers), based on what the inspector tells. The alpha value is set as expected.

tk2dBaseSprite sprite = GetComponent<tk2dBaseSprite>();
sprite.color =new Color(Random.Range(0,256), Random.Range(0,256),Random.Range(0,256),255);

I've also noticed that setting the values explicitly yields odd results. Setting it to (100,100,100,255) actually sets it to (40,43,112,255).

6
Showcase / Super Desk Job!
« on: February 15, 2013, 03:00:32 am »
A (non)Game about working a dead end office job. It isn't fun, but that's the point.

http://gamejolt.com/games/other/super-desk-job/12004/

7
Showcase / Bit Tanks: A Missile Defense-like Arcade Game
« on: January 11, 2013, 10:56:06 pm »
I just finished Bit Tanks and released it the other day on a "Pay What You Want" scale. You can check out more information about it here:
http://www.joshuahriley.com/#!bit-tanks/cvhm

8
Showcase / Ludum Dare 25: The Adventures of Jack Lumber
« on: December 19, 2012, 02:21:59 am »
I made this game for Ludum Dare 25, themed "You Are the Villian". You play a lumberjack who must destroy the forest without alerting the hippies.

http://www.kongregate.com/games/SgtSquirrelly/the-adventures-of-jack-lumber

9
Thanks for the help. I switched to 2D Toolkit from Orthello a few weeks ago and love it! It probably makes my workflow twice as fast, not to mention making my games more efficient several times over. 

10
Looked at it again with fresh eyes, and I'm an idiot...It looks like the distorted colliders are because the colliders aren't flipping when I flip the sprite (using the FlipX method in code), which I assume is expected behavior. I'm still not sure why I'm getting the error message, but it doesn't seem to be affecting anything at all in my game. I'd be happy to send you my project if you want to still take a look, though.

Also, do you know of a way I could solve the new problem? I can think of a few workarounds, like having separate sprites, or creating a second prefab that is flipped before runtime (clicking Hflip in the inspector correctly flips the collider), but I'm guessing I've missed something simple.

11
Thanks for replying so quickly!

I really only have one actual animation, and all frames are box colliders with the exact same image and collider dimensions. The rest were just one frame "animations" because I was planning to do the artwork later, and didn't want to rewrite code when I do. I've since temporarily changed those to sprites.

However, I'm still getting the error message, and still getting the messed up polygons on my now unanimated sprites, even before I instantiate an animated sprite and get the error message.

12
Support / "Invalid Mesh Collider on Sprite, please remove and try again"
« on: November 23, 2012, 07:42:59 pm »
I'm not sure what's causing this, but I get this message anytime I instantiate almost any of my (animated, for what its worth) sprites. It appears to come from the CreateCollider() method in the base sprite class. It seems like its not getting the collider data from the Sprite Collection at run time. Any idea what the problem is?

Also, it doesn't seem to affect anything other than distorting my polygon colliders, and also only seems to affect my standalone builds, not my web builds.

13
Support / Unmerge Colliders
« on: November 22, 2012, 02:59:19 am »
It seems like when I make an animating sprite a child of another animating sprite (in this case, a parachute of a paradropper), it combines the meshes as well. Basically, I would like to be able to destroy the parachute and the trooper independent of one another, but I haven't yet found a simple way to do so.

Pages: [1]