Jump to content
  • entries
    11
  • comments
    4
  • views
    16,243

What i'm coding now


bfg.gamepassion

688 views

I'm working on generic/reusable routine for action game.

 

First : A structure for "TimeLine". The aim is to trigger action at a certain "time" or place on screen/scrolling.

 

Example :

 

At 5 seconds : Trigger 4 ennemy of type Monster 1, with movement type Movement 1, define start position of all ennemy

At 10 seconds : Trigger 1 ennemy of type Monster 2, with IA movement 1 , ...

At 15 secondes : Trigger an object bonus at position 0,0 With no movement

At 20 seconds : Loop at 20 seconds until end of level.

 

Second : An action movement structure.

 

Movement 1 :

 

Move 5 pixel to the left

Shoot arrow

Move 5 pixel to the right

Loop

 

Third :

 

The routine to read and decode this structures in game.

 

For the moment it works well and i can move 32 sprites simultanely without slowdown. No collision detection for the moment,no animation, and i haven't implemented all the different object.

So i think there will be slowdown at last, so maybe i'll have to simplify the possible action, or optimisation will help.

 

The goal is to use the first time these routine in my next game.

2 Comments


Recommended Comments

I was reading something recently which talked about using prime numbers for intervals creates effectively long, almost random, patterns. So rather than have thing one happen every 5 seconds and thing two happen every 10 seconds you have thing one happen every 7 seconds and thing two happen every 11 seconds.

Link to comment

The way I do this is to add an extra line of data to the map data with "trigger" codes.

 

As you move along the map data, pull the code out and do what's required.

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...