Giter Club home page Giter Club logo

seed's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

seed's Issues

Certain Sprites Animate Only While Moving

We need to ensure that certain sprites only animate while moving. For example if I am running to the left or right, i should show the left or right animations and stop animating when I stop (and possibly jump back to the first frame of the animation)

Sprite "Hit Box"

Sprites need to keep track of not only their size, but their "actual" size, aka the contents within them.

The easiest course of action will probably be to just manually assign a sprite size (height / width) and a sprite hitbox size with xy coordinates that are relative to the sprite.

For example, given SpriteA with the following information
Size: 64x64
Location: 0,0

We know that the SpriteA contains an image of a ball that is only 32x32 pixels. In the current frame the ball is located at the very bottom of the sprite image and centered.
Hitbox size: 32,32
Location (Top Left), 12 ((sprite size - sprite hitbox width) / 16), 32.

We will need to calculate these sprite hit boxes for each and every sprite that it matters. (looking like sprite drawing software that understands this will be very important to have or create).

Rotating sprites

Create a method to rotate sprites over a period of time

if the period of time specified is 0 then rotate instantly

rotation is in degrees (need to convert from radians) .

Rotation should happen smoothly over a given period.

Sprite Groups

We need to be able to create groups of sprites, grouping them together in some fashion. For example a boss could be a combination of sprites joined together.

Or a map layout could be the combination of many sprites to create the environment, each with their own set of rules/information.

Timed events

We need a way to key events based on time. I think our game engine needs to keep track of time and cache it at the start of each render/frame.

Like

GameEngine::GetTime()

That will return the time in Milis as well as update a static LONGLONG that points to the current time.

Then I can lets say on game go, hey has 5 seconds elapsed since the last time i checked (keeping track of my own internal time from the last time a frame was rendered)

If so then do something !

So GameEngine::GetTime(bool) (currently have Time::GetTime() will be easy enough to stuff that into the game). The bool will true update cache, or false just returns what's been cached .

Then in GameLogic::EventTriggers

we can do something like

if (GameEngine::GetTime(false) - GameLogic::EventTrigger::Time() > 5000 )
// Do something because 5 seconds has passed since our triggers time

We also need a way to keep track of event triggers like this, they can be character specific - like if you stand idle for too long. Dungeon specific (after 10 minutes of being in a dungeon all monsters become stronger, but i doubt we'll do that, just an example). Auto pause if no input is detected...etc

Then there are EventTriggers that happen because of other things in the game, but I'm not too worried about those at the moment. that's more on the game logic side of things.

Game "Layers"

This could possibly be engine logic, or game logic. But we need to layer-ize our sprite display with the obvious layers

Background
NPCs / Main-Character
Foreground

Character / NPC Sprite Z-Ordering

We should handle our zorder by looking at the bottom edge of a sprite.

The bottom of edge of a sprite will determine if a sprite is closer to us or further away. For example:

MainCharacter1 is at XY position 30,30
NPC is at XY position: 30,24.

We would display MainCharacter1 on top of NPC1 because NPC is closer to the top of the screen, therefore (based on the camera) would be behind the sprite at Y position 30.

Support for Keyboard / Mouse / Gamepad

Right now we only handle XBox360 Controller input, we should do the following:

Handle Keyboard / Mouse input
Handle Gamepad input (other than xbox360)

Create one wrapper class that encapsulates all three/four input methods with external methods like

didMoveLeft
didMoveRight
didInteract

So the user can just specify the input method, but the manner in which control is handled is very generic.
Performance handling of the keyboard / mouse / joypads can be done with the following API(s):
DirectInput
CreateDevice

Sprite sheets

We really need some dummy sprite sheets with the following

1 map that is bigger than the game window
1 map that is smaller than the game window

1 main character
1 NPC

1 tile set with basic tiles.

Sprite mapping

We need a DI like way of sprite creation, relying on code generated sprites is annoying.

Create an xml structure to define sprite creation. The files can be ingested and then used to generate all of the sprites for the game at once, only creating the texture resources when needed.

<sprites>
<sprite name="MyMainCharacter" type="character/npc/background" >
<textureMaps>
  <textureMap name="sheet1" 
                         resource="/path/to/texture/map.png"
                         height="512" 
                         width="512" 
                         cellSize="32" />
  <textureMap name="sheet2" 
                         resource="/path/to/texture/map.png"
                         height="64" 
                         width="512" 
                         cellSize="32" />
</textureMaps>
<!-- for characters / NPC we will identify their animations in almost the same exact way
but NPCs will have an additional field for setting default walk paths --> 
<path startDirection="Up">
  <pattern>UULL</pattern>
<path>
<animations>
  <animation name="walkingLeft" map="sheet1" duration="in-milliseconds" frames="4">
    <cellPosition x="3" y="2" />
  </animation>
</animations>
<!-- for backgrounds / tile sets we'll just map out where to find stuff in the tile set --> 
<tiles map="sheet2">
  <tile>
    <span x="1" y="1" />
    <cellPosition x="2" y="2" />
  </tile>
</tiles>
</sprites>

Let there be sound

A game engine that cannot play sound is no game engine of mine. We should start looking into what kinds of libraries are available for this, what formats to support, what features to have...etc

Sprite animations during movement

We need to keep the animations synced, so if i am running up and am currently on frame 7 of a 10 frame run animation and I press to turn up and to the right or all the way to the right it should jump me to frame 7/8 of the animation for those directions.

This should (i would imagine) prevent jittery ness when changing directions. as long as each direction contained the same number of frames that were all synced to the correct pose just at different angles.

Create Fade Logic for Fading a scene out

Should be able to fade a scene out to a color (probably black since that's a common effect).

Take all of the visible sprites, over a given duration (in seconds) fade them all to the color black (colormodulate = 0, 0, 0, 1)

This should create the effect of a black fade out.

Sprites animation with timers

Sprites us a very basic way of determining when to animate, it works well at high frame rates but completely falls apart at lower frame rates.

Should the sprite maybe keep track of it's own QueryPerformanceCounter, or maybe GetTickCount()?

Not sure, but I need the sprite to always run in the given duration regardless of the frame rate. Which it currently sort of does and does not.

Sprite Positions

Create an enum for defining sprite positions relative to the world

positions

  • bottom-left
  • bottom-right
  • top-right
  • top-left
  • centered

Sprite scrolling

Need to handle sprite scrolling.

This means translating every objects position in the world.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.