10 Replies - 665 Views - Last Post: 29 June 2012 - 06:17 PM

#1 redcodefinal  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 26-March 11

game library similar to Flixel or X-Flixel called Clixel.

Posted 28 June 2012 - 04:21 PM

I've been writing some code for a game library similar to Flixel or X-Flixel called Clixel. I've written 99% of the code from scratch and, I'm starting to hit a lot of errors. I wanted to start writing unit tests so I looked at some tutorials online and I am still a really confused. I think my code could use a more professional eye, since I am still a very amateur programmer. I'd really really appreciate someone coming on Skype or Join.me to help me look through, since I'm not sure what I am missing. I could also appreciate some unit testing and debugging tips. I know most of you are really busy, so any time you guys take out of your day to help me is greatly appreciated. If you can't help through Skype or Join.me, I could really use any good, comprehensive unit testing tutorials.
I'd post the errors but right now there are too many to count. Please help me :(.

Library on GitHub.
https://github.com/r...Clixel/tree/Dev

Join.me right now.
https://join.me/677-043-693 Thank you so much.

Is This A Good Question/Topic? 0
  • +

Replies To: game library similar to Flixel or X-Flixel called Clixel.

#2 Kilorn  Icon User is offline

  • XNArchitect
  • member icon




Reputation: 1325
  • View blog
  • Posts: 3,504
  • Joined: 03-May 10

Re: game library similar to Flixel or X-Flixel called Clixel.

Posted 28 June 2012 - 05:11 PM

I downloaded your entire source code and the only problem I had getting it to run was the fact that I didn't have the right font that you've set in the SpriteFont file. No big deal, I changed it to Arial, and it works perfectly mine on my computer. What sort of errors were you getting?
Was This Post Helpful? 0
  • +
  • -

#3 redcodefinal  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 26-March 11

Re: game library similar to Flixel or X-Flixel called Clixel.

Posted 28 June 2012 - 05:17 PM

Mostly errors with objects beng null, etxt rendering etc etc, you might want to go grab that font though, it's really cool -> http://www.dafont.co...-cellphone.font
Right now I am having an issue with the button text not centering properly. I also need some help with writing the unit test, it's something I have never done before, and I am very confused. Do you have a skype? It'd be easier to talk about it there.
Was This Post Helpful? 0
  • +
  • -

#4 Kilorn  Icon User is offline

  • XNArchitect
  • member icon




Reputation: 1325
  • View blog
  • Posts: 3,504
  • Joined: 03-May 10

Re: game library similar to Flixel or X-Flixel called Clixel.

Posted 28 June 2012 - 05:25 PM

I've attached a screenshot of what I see when I run your project. Is this not what it is supposed to be?

EDIT: Also, the screen turns green if I take the cursor out of the bounds of this window.

Attached image(s)

  • Attached Image

This post has been edited by Kilorn: 28 June 2012 - 05:25 PM

Was This Post Helpful? 0
  • +
  • -

#5 redcodefinal  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 26-March 11

Re: game library similar to Flixel or X-Flixel called Clixel.

Posted 28 June 2012 - 05:30 PM

Whoops, I left the old mousestate. Just go into Game1.LoadContent and change mousetest.Show(); to menu.Show();

Oh alsoe make sure you are on the Dev branch, not the Master branch on GitHub, the Master branch is old.
Was This Post Helpful? 0
  • +
  • -

#6 Kilorn  Icon User is offline

  • XNArchitect
  • member icon




Reputation: 1325
  • View blog
  • Posts: 3,504
  • Joined: 03-May 10

Re: game library similar to Flixel or X-Flixel called Clixel.

Posted 28 June 2012 - 07:10 PM

Downloaded the code from the Dev branch, just to make sure I had the right code, and it turned out I didn't. Now when I run the code from the Dev branch, the below image is what I get. This is while clicking on the second "button" square thing. It turns blue when the mouse button is held, and it is red if I'm hovering over it. No errors on build, but when opening the solution there were a couple of projects that couldn't be loaded, but they weren't needed in order to build it.

Attached image(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#7 redcodefinal  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 26-March 11

Re: game library similar to Flixel or X-Flixel called Clixel.

Posted 28 June 2012 - 08:06 PM

Yeah. The ClxText TextRender in ClxButton should be centered to the button. For some reason it's not. If you want, we could get on Skype so I explain what I coded if you needed me to.
Was This Post Helpful? 0
  • +
  • -

#8 Kilorn  Icon User is offline

  • XNArchitect
  • member icon




Reputation: 1325
  • View blog
  • Posts: 3,504
  • Joined: 03-May 10

Re: game library similar to Flixel or X-Flixel called Clixel.

Posted 29 June 2012 - 05:58 AM

The values for the first button on there, button 12, are as follows: position.X = 100, position.Y = 100, width = 22, height = 24. The values for the text for that first button are: position.X = 105, position.Y = 119, width = 12, height = 14.

If you want the text to be in the center of the button, you need to figure out mathematically where the center of the button on the X axis. To do this, you can simply add half of the width to the position.X, or 100 + width/2, which would give you 100 + 11 = 111. You also need to know the center point on the Y axis. To do this, you can simply add half of the height to the position.Y, or 100 + height/2, which would give you 100 + 12 = 112. This is the center point of the button.

Now you need to figure out how to get the center of the text at the same point. You can find the center of the text by doing the same math that I mentioned above. Take half of the width of the text and add it to the position of the text, or 105 + width/2, which is 105 + 6 = 111. Then take half the height and add it to the position.Y, or 119 + height/2, which is 119 + 7 = 126. 111, 126 would be the center of the text.

The center of the button is (111, 112), the center of the text is (111, 126). With the current position of the text, it would not line up to the center of the button, so you need to do some more math to figure out where the position of the text needs to be in order to have the text in the center of the button.

One simple way to do this is to set the position of the text to the center of the button, minus half the width and half the height of the text. The values for that would be text position: (111, 112), half the width of the text is 6, and half the height of the text is 7. position.X = 111 - 6, position.Y = 112 - 7, or programatically:
text.position.X = 111;
text.position.X -= text.Width / 2;

text.position.Y = 112;
text.position.Y -= text.Height / 2;



The variables names I've used above are not going to be correct because I don't have your code directly in front of me since I am at work right now, but this should give you an idea on how to go about finding the center points of each button, each text, and how to adjust the position of the text for each button to align the center points properly.

I won't be using Skype, as I would prefer to keep any help that I offer on the forums so that others who run into a similar issue might easily be able to find this thread to help resolve their issues.
Was This Post Helpful? 1
  • +
  • -

#9 redcodefinal  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 26-March 11

Re: game library similar to Flixel or X-Flixel called Clixel.

Posted 29 June 2012 - 05:43 PM

Completely understandable, that was rude of me, I used to run a forum so I should have realized what I bringing the topic off-forum.

I made an update and everything *seems* to be working. I'm still writing millions upon millions of unit tests to check any issues.

I think what I am more afraid of than bugs is the design of my engine. I've never worked on such a big project, so it's a bit daunting sometimes. I just wanted to make sure I was on the right track to something Flixel-like.

Is it possible if you could help me with my collision system when you get back?

I know there are cooler ways to do collision detection, like quad trees, and I will ned to implement those later when I start doing collisions for particles. Here's how my system works right now.

In the ClxObject class we have a small piece of collision detection code called UpdateCollision(). Each ClxObject has a list of other ClxObjects called CollisionPartners. This is where all the objects that this ClxObject can collide with. Every update the UpdateCollision() is called and if there is a collision it runs both it's and the colliders onCollide() method. I make express sure to only allow this to be run once per frame, since it can become an endless loop of onCollide() if you don't.

The problem I am having is actually physically colliding the objects so that way an object can't move past another object who is on the collision list and marked solid.

I was also wondering if you had any unit testing tips, it's something that I have never done before and, I think I am doing them right but, I want to make sure.

This post has been edited by Kilorn: 29 June 2012 - 06:03 PM
Reason for edit:: Removed the double posted portion.

Was This Post Helpful? 0
  • +
  • -

#10 no2pencil  Icon User is offline

  • Original Digital Gansta
  • member icon

Reputation: 4463
  • View blog
  • Posts: 24,906
  • Joined: 10-May 07

Re: game library similar to Flixel or X-Flixel called Clixel.

Posted 29 June 2012 - 06:01 PM

** renamed title to be more descriptive of discussion **
Was This Post Helpful? 2
  • +
  • -

#11 redcodefinal  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 26-March 11

Re: game library similar to Flixel or X-Flixel called Clixel.

Posted 29 June 2012 - 06:17 PM

View Postno2pencil, on 29 June 2012 - 06:01 PM, said:

** renamed title to be more descriptive of discussion **


Thank you. :D
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1