• entries
26
33
• views
8089

# Untitled

108 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 ActorBat = 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 actorBat.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 Handlerfunction OnEventName(This, Args)	This.X += This.Speedend-- 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.

There are no comments to display.

## Create an account

Register a new account