Atomic for PSP (beta)

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
SiGi
Posts: 11
Joined: Thu Oct 20, 2005 3:24 am
Location: Phoenix, AZ

Atomic for PSP (beta)

Post by SiGi »

I am currently working on a port of WAtomic (http://watomic.sourceforge.net/). I'm using the same levels and graphics. Check out a screenshot:

Image

The core game is basically done. You can download it here: http://members.cox.net/msikora2/AtomicBeta.rar

I included LUAPlayer v 0.11 as well, because with later versions it does not work correctly (it is too slow and it doesn't blit transparent images). And that is my question - why are my transparent images not displayed and why is the slowdown so bad (I am displaying only 6 sprites at a time)? Also, does sb have a source of LUAPlayer v 0.11, so I can release a standalone version?

I would also appreciate any suggestions concerning the gameplay, layout, etc. Right now, the player can access any of the 83 levels (that's how WAtomic/KAtomic works), but I'm thinking, it would be more rewarding for the player to work his way to the higher levels, and each level would have a time or number of moves limit (or both), that would have to met in order to advance.

Plans for later versions:
-changes in gameplay
-much more extensive menu (including player profiles, options, etc.)
-custom bitmap fonts
-possibly improved graphics and backgrounds
-sound
-music
-UNDO function
-compatibility with newer versions of LUAPlayer
-...


Please, give me your suggestions, I'd love to release a really polished and enjoyable game.

Note to webmasters: PLEASE don't release this game on general PSP websites yet, this is only a beta and I'm planning to make major changes in the final version, which is coming soon. I'm posting it here to only get suggestions from the LUA developing community.
SiGi
Posts: 11
Joined: Thu Oct 20, 2005 3:24 am
Location: Phoenix, AZ

Controls

Post by SiGi »

BTW, Controls are:

arrows: move the pointer or an atom, navigate the menu
cross: pick/drop an atom, execute menu command
start: menu
L/R buttons: focus on previous/next atom
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Re: Atomic for PSP (beta)

Post by Shine »

Nice game. I have no problems with Lua Player 0.15. But this is a good example for using timer based blits. If the game is getting more complicated, you can't be sure to do everything within 1/60 second, including game logic etc. For your game I don't know, why it is so slow, perhaps you should buffer a bit more or count your number of blits again (your code looks a bit long winded, so I didn't analyze it in detail), but these are the changes for rewriting it to a timer based animation (works with Lua Player 0.15) :

Code: Select all

$ diff -u index.lua index2.lua
--- index.lua   2005-12-03 09:46:50.720753600 +0100
+++ index2.lua  2005-12-03 20:40:25.515625000 +0100
@@ -6,7 +6,7 @@



-animeSpeed=4.5 --Speed in pixels per screen refresh, number should divide 18 (e.g. 4.5: 4.5*4=18)
+animeSpeed=1/3 --Speed in pixels per millisecond, can be every value

 CenterX=240
 CenterY=136
@@ -1598,10 +1598,10 @@

    if items.animate~=nil then

-      items.animateProgress=items.animateProgress+animeSpeed
       local val=items[items.animate].val
+      local progress = items.animateProgress:time() * animeSpeed

-      if items.animateProgress>=(items.animateLen*18) then
+      if progress>=items.animateLen*18 then

          local x=items[items.animate].x-1
          local y=items[items.animate].y-1
@@ -1618,19 +1618,19 @@
          local y=items.oldy-1

          if items.animateDir=="up" then
-            aBuffer:blit (18*x,(18*y)-items.animateProgress,level.atoms[val])
+            aBuffer:blit (18*x,(18*y)-progress,level.atoms[val])
          end

          if items.animateDir=="down" then
-            aBuffer:blit (18*x,(18*y)+items.animateProgress,level.atoms[val])
+            aBuffer:blit (18*x,(18*y)+progress,level.atoms[val])
          end

          if items.animateDir=="left" then
-            aBuffer:blit ((18*x)-items.animateProgress,18*y,level.atoms[val])
+            aBuffer:blit ((18*x)-progress,18*y,level.atoms[val])
          end

          if items.animateDir=="right" then
-            aBuffer:blit ((18*x)+items.animateProgress,18*y,level.atoms[val])
+            aBuffer:blit ((18*x)+progress,18*y,level.atoms[val])
          end

       end
@@ -1817,7 +1817,8 @@
       items[i].y=y
       pointer.x=x
       pointer.y=y
-      items.animateProgress=0
+      items.animateProgress=Timer.new()
+      items.animateProgress:start()
    end

 --FieldBlit () --DEBUG CODE
The full source code: http://www.frank-buss.de/tmp/atomic.lua
User avatar
JoshDB
Posts: 87
Joined: Wed Oct 05, 2005 3:54 am

Post by JoshDB »

Aw man, I was gonna make a game like this, except it was gonna be called Links...

An idea was that they kept growing randomly, and you have to somehow destroy all of them.

Good job, though.
Post Reply