Recent

Author Topic: BGRA Games  (Read 25445 times)

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: BGRA Games
« Reply #30 on: October 21, 2014, 12:51:43 pm »
I was thinking, about optimisations, that there may be some way to improve the speed of your current BGRAGame that would make it fast enough. It would be to redraw only the parts of the image that has changed. So if there are only 10 sprites going around, that would be really fast.

Yes, ease of use is important for me, as much as full Pascal programming.  8-)
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: BGRA Games
« Reply #31 on: October 21, 2014, 06:37:48 pm »
I've readed that somewhere, searching for android tilemap ideas.

In Windows is fast enough also redrawing the entire tilemap in each frame!

But I'm trying to port it to Android - I have no idea how to configure FPC, Lazarus and BGRABitmap to work with -  but Android comes with canvas easy to use.

The optimization you say is the only way that a tilemap will work fast on Android canvas. In the other hand I can use OpenGL ES that comew with Android too, but is a lot harder to use.
« Last Edit: October 22, 2014, 03:43:24 pm by 007 »

mercury

  • Full Member
  • ***
  • Posts: 154
Re: BGRA Games
« Reply #32 on: February 15, 2015, 01:45:02 pm »
looks cool, but it says 'This project has no files.'.
so, where can i download it?

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: BGRA Games
« Reply #33 on: May 09, 2015, 05:26:22 am »
looks cool, but it says 'This project has no files.'.
so, where can i download it?

there is a source section with svn repo

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: BGRA Games
« Reply #34 on: June 13, 2015, 05:23:40 am »
Hi, there is an update to BGRAGames repository:
- Now it comes with 'leveloid' 0.7 sources and fixes to the setup
(Now you can see whats inside the file if preview panel is enabled in explorer both for level and script files like for .txt files)
- Everything that is new to the game since the last update (pascal script support, etc.. everything is here now)

Precompiled binary for windows can be downloaded here:
leveloid.sourceforge.net

Some hints:
- Move with arrow keys
- Press F1 to switch between normal, gameboy and black and white color modes

Levels:
- With leveloid installed go to the levels folder and double clic any level file to run it.
- Right clic the file and press edit to enter into editor.
- The leveloidscript files are pure pascal script code, edit this files to add custom stuff to the level including: player physics, events and music.

Compile:
- Just compile and put executables in place in order to create the setup (just move the level editor to right place).

leveloid is a game made with bgra-games (bgrabitmap, uos and spdjoystick).

The next step is to use BGRA OpenGL to improve speed and graphics in general.

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: BGRA Games
« Reply #35 on: June 13, 2015, 08:53:24 am »
Hi! Binaries run fine here on Windows7 and 32-bit processor.  :)
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: BGRA Games
« Reply #36 on: June 13, 2015, 11:07:52 am »
Thanks, Enjoy the levels :)

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: BGRA Games
« Reply #37 on: June 16, 2015, 07:14:30 pm »
Alright, now:
- BGRAGames has TBGTileMapGL
- leveloid is now working with TBGTileMapGL, levels and editor are all compatible. So the game is the same :)

ToDo:
- Properly use Timer, like in the bgra opengl demo, that works smoothly.
- Add filters (GameBoy, BlackAndWhite), maybe they need to be used when we draw the tiles? Or is possible to apply to whole screen...

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: BGRA Games
« Reply #38 on: June 16, 2015, 07:24:10 pm »
Cool!

About filters, I would suggest to apply them to the tileset. For example, you could reload the tileset when you change the mode and apply the chosen filter.
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: BGRA Games
« Reply #39 on: June 22, 2015, 08:31:24 am »
If I'm not wrong the bitmap is always accessible so it will be easy to add.

Is left the timer improvement, any suggestion based on the current implementation? I've not added the code as you did in the bgra demo, I'm using a TTimer.

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: BGRA Games
« Reply #40 on: June 22, 2015, 06:43:24 pm »
Yes.

About the timer, you can accumulate elapsed time in a floating point variable. You can simply add the difference between Now() and its previous value. Then you can determine how much grain of time have passed. For example, if you had a timer every 15 milliseconds, you can determine how much intervals have passed by dividing the elapsed time by 15 milliseconds (and apply trunc). So you know how much frames have passed.

You need to make the difference between computing the movement of the objects and the drawing on the screen.

Then you can multiply the number of frames you computed by 15 milliseconds to subtract it from the accumulator. The accumulator must not be set to zero, because sometimes you get 1 or 2 milliseconds, and you need to add them until you get a grain of time.
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: BGRA Games
« Reply #41 on: June 22, 2015, 10:14:44 pm »
Ok. I'll try. Thanks!

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: BGRA Games
« Reply #42 on: June 24, 2015, 06:23:58 pm »
In svn of BGRAGames:
- Added resample filter orfBox in bgtilemapgl to get the same look as using bgtilemap.

 

TinyPortal © 2005-2018