Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


desdemian

Member Since 19 Sep 2004
Online Last Active Today, 08:57 PM

Posts I've Made

In Topic: What are scene managers and how do they work?

29 June 2015 - 08:04 PM

This is just a guess, since you are not specifying what code are you talking about, what game, who are theses "people"... so whatever answer I give is based on very little facts your question presented.

 

Having said that, if I had a SeneManager on my code, I would probably have Scenes as well.

 

A scene would be any section of my game that starts and stops at some point.

 

For example the main menu is a scene.

The screen that shows the logo at the beginning of my game is a scene.

The screen with highscores, and the settings menu are also scenes.

Each level of the game is a scene.

Even a pop-up dialog could be a scene.

 

So the scene manager is in charge of, well, managing theses things. For example in can load the logo scene, and when its over somedy tell the manager to unload Logo and load MainMenu.

The manager could have more than one scene at a time: if you load a PopUpScene you put it over the current scene. You can still see the scene below, but you are currently working in the scene at the top. When the popScene exist the manager removes it and it is left the original scene at the bottom...

The manager could also be in charge of transitioning between scenes with som sort of effect (fades and whatnot).

 

These are all suggestion. If you have access to some code that uses a SceneManager, dig into it and find what it does...

 

 

As for the inheritance part, SceneManager does not inherit from anything (maybe if you have a Manager class before... but... mm...).

It stands on its own.

Usually the flow is: main() starts, you create a scene manager, and you put the first scene into it so it is shown on screen... 


In Topic: Pacman style collision detection Unity 5

25 June 2015 - 10:53 AM

I have a game that works in a similar way to pacman (ie is a tight maze). I have 2 issues.

1: I have a player object which is around 50 pixels square and I have added a boxcollider2d to it that is 60 pixels square. I am trying to move this player down the corridor which is 60 pixels wide but if I press against the wall it seems to get partially stuck and moves as if it is in treacle until it is clear of that particular wall tile. It also seems to get completely blocked occasionally by wall tiles. If I make the boxcollider2d 58 pixels square then my player moves fine even after being pressed up against a wall tile. However this also means there is some sideways movement in the corridor by 2 pixels as the object is no longer exactly the same width as the path.

2. If I am moving say to the right and there is a path leading down, I have to be pixel perfect in my alignment in order to change direction. Pacman never has this issue. Do I need to have a sweet zone where it automatically aligns my character with the path or is there a better way?

 

Here are a few random suggestions in no particular order:

1.- Turn friction and restitution to zero.

2.- Turn your walls into edges and link them with "vertex0" and "vertex3" (Box2d manual: chapter about "edge shapes" and "chain shapes").

3.- Turn your character collision into a circle, not a square.

4.- Turn your character collision into four, small, revolute-joint circles (north, east, west, south), so he "rolls" along the hallways.

 

But to be honest... It seems to me that using box2d is giving you more headaches than solutions.

Unless your game really needs them, I suggest you forget about realistic physical collision and just implement your own solution for this game... the way pacman did it.


In Topic: PONG stop the ball from shaking? AI player. Suggestions

11 May 2015 - 11:22 AM

I think this is your problem.

if (moveDistance > ballDistance)
{
   moveDistance = ballDistance / 2;
}

Splitting the distance in half is quite arbitrary. How about: moveDistance = Math.Abs(ball.direction.Y)
That way you if you are too close, you match the speed of the ball and you never go over/under.

Hope that helps.


In Topic: What is the trick in box2d to build slalom track for car?

06 May 2015 - 10:37 AM

It sounds like you want one way collision on certain parts of your track?  Maybe this would help? http://www.emanueleferonato.com/2010/03/02/understanding-box2ds-one-way-platforms-aka-clouds/

 

I don't think this would work. It's ok for the left bridge (the one you collide when going out, but not going in), but it would fail on the right bridge, that is always hit from the same direction.

 

I suggest following Alex's advice:

* first build the same structure of the image alex is showing you

* then fill the blank parts with two separate bridges, and deactivate the one on the left so the car can come inside.

* put a sensor on the top of the loop, and if the car hits it, deactivate the right bridge and activate the left one.

 

I think that should be enough... It also has the plus side that if the car is not going fast enough, it can go backwards and exit the loop without problems.


In Topic: what is the origin of your nickname/Internet handle?

24 March 2015 - 07:00 PM

I swear I learnt in high school that desdemian spectrum was the scientific name for "bat".

 

It isn't.

Google returns nothing when looking that term.

It is inexistent... like my career as a game developer... so, appropriate.


PARTNERS