Sign in to follow this  
  • entries
    26
  • comments
    33
  • views
    7978

Untitled

Sign in to follow this  
Namatsu

58 views

Ok... So I did some thinking and These are the subsystem I came up with that I need. Yes at first all this is just going to be for a pong game. I do want to design this though so i dont have to code everything over again on my next project. So alot of this may seem overkill.

*Renderer
*Physics
*Sound
*Scripting
*Resource
*GUI
*World - being a series of maps
*Map
*Sprite
*Actor

As far as scripting goes. I'll probubly be using lua, as that is what i'm most familar with.

I usually end up going with a generic actor that I can expand through lua in my engines. So far this is what I've come up with as far as how I would like it to look in the scripts.


-- Creates a new Actor
Bat = Actor.New()
-- Makes the Actor a Physical Entity in the World, as not all actors will require a sprite or collision.
Actor.MakePhysical(Bat)
-- Once we have been made physical we should now have access to the functionally that comes with that.
Bat.Sprite.Set(BatSprite)

-- Adding and assigning the speed variable to the bat actor
Bat.Speed = 1

-- Another Possibity for adding variables
-- This way would allow for adding c++ classes as member variables.
Bat.AddVar("Speed",VarType::Int)
Bat.SetVar("Speed",1)
Bat.GetVar("Speed")

-- Defining an Event Handler
function OnEventName(This, Args)
This.X += This.Speed
end
-- This function would add the Event Handler and also subscribe the Actor to that event type.
Bat.AddEvent("EventName",onEventName)




I'm still undecides as to if this is the aproach I'm going to take. But at least I'm planning.

More updates on the way once I make more plans.

Edit: I think I'd rather go with a Bat.Move(Bat.Speed,0) where the function automaticly takes care of the time based movement for you.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now