Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411594 Posts in 69387 Topics- by 58444 Members - Latest Member: YomiKu_0

May 08, 2024, 03:50:34 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)CSZone - Simple Open Source C# .NET 2D Game Engine
Pages: [1]
Print
Author Topic: CSZone - Simple Open Source C# .NET 2D Game Engine  (Read 972 times)
realmaster42
Level 0
*



View Profile WWW
« on: September 12, 2016, 03:28:15 AM »

Hello everyone!

Recently I've been working my newest open-source C# project.
CSZone, CSZone is a simple, open-source, 2D C# .NET Game Engine.

It features some usefull functions and it is still in development.
It is in it's alpha stages and requires a lot of feedback, and will surely update a lot, since it is a WIP (Work in Progress).

You only need to copy the class's source code, create a new class inside your project named CSZone.cs, and paste the code.
(PS: Don't forget to rename the namespace of the CSZone class)

For anybody willing to try it out, here is the link:
https://github.com/realmaster42/CSZone

Every kind of criticism is allowed.
I recently added a decent update that changes all of the controls to a single pictureBox, hopefully increasing perfomance a lot.
Logged

agedev
Level 0
**


View Profile
« Reply #1 on: September 12, 2016, 08:32:38 PM »

A few small things that jumped out at me:

In your draw loop you have nested exception handling. The inner layer seems to simply be a way to capture changes in the list of drawables. It might be better to at least simply lock this list. Save catching exceptions for things you can do nothing about.

Another one is your collision test. I am not sure I understand the size check before testing; it would cause only matching sized rectangles to collide. But a simple box test (assuming sizes >= 0):
take
min_a = objectpoint1
max_a = objectpoint1 + objectsize1
min_b = objectpoint2
max_b = objectpoint2 + objectsize2

and test (min_a < max_b && max_a > min_b)

(may want them to be <= and/or >= to get edges). It will also work in any dimension for any axis aligned bit of geometry.


I realise it is very early, but it may also be handy to split up the file. Looks like you have an entity/drawable, a camera and a scene/drawlist all sort of mixed together. There is a dozen different ways break them up (all a matter of preference & goals), but you will quickly find things daunting if you don't do it early.
Logged
realmaster42
Level 0
*



View Profile WWW
« Reply #2 on: September 13, 2016, 07:02:51 AM »

Quote from: agedev
In your draw loop you have nested exception handling. The inner layer seems to simply be a way to capture changes in the list of drawables. It might be better to at least simply lock this list. Save catching exceptions for things you can do nothing about.
Good idea! Perhaps I should verify if the list is the same, and if it isn't, add new objects to a separate list, and when ended adding them back to the list.

Quote from: agedev
Another one is your collision test. I am not sure I understand the size check before testing; it would cause only matching sized rectangles to collide.
Yeah... I still haven't got really working on the collision, as I were too focused on important stuff. Thanks for the feedback anyway!

Quote from: agedev
min_a = objectpoint1
max_a = objectpoint1 + objectsize1
min_b = objectpoint2
max_b = objectpoint2 + objectsize2

and test (min_a < max_b && max_a > min_b)

(may want them to be <= and/or >= to get edges). It will also work in any dimension for any axis aligned bit of geometry.
Thanks! I'll use it.

Quote from: agedev
I realise it is very early, but it may also be handy to split up the file. Looks like you have an entity/drawable, a camera and a scene/drawlist all sort of mixed together. There is a dozen different ways break them up (all a matter of preference & goals), but you will quickly find things daunting if you don't do it early.
Yeah, I plan to split it up on the future, but right now I don't think it is time, as you said too. Wink

Thanks for the feedback!
I'll surely update it right now and make it better.
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic