android
  #1  
Old 12-11-2010, 07:08 AM
Android18 Android18 is offline
Junior Member
 
Join Date: Dec 2010
Location: Pokhara,Nepal
Posts: 35
Default Rocket game

Hwy i am new here

can u help me



u can try my app but i am really confused now
and why does it slow down in zen not in simulator
Attached Files
File Type: zip Rocket.zip (6.9 KB, 57 views)

Last edited by Android18; 01-30-2011 at 06:10 AM.
Reply With Quote

Advertisement [Remove Advertisement]

  #2  
Old 12-11-2010, 07:42 AM
Habhome's Avatar
Habhome Habhome is offline
Moderator
 
Join Date: Jan 2010
Location: Sweden
Posts: 1,079
Default

The simulator works on a much higher frequency than the device itself, it is a known bug to us developers, and it makes it a pain to try some things on the sim.

[Thread moved into Dev]
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine
Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it!
Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it.
Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^
Reply With Quote

  #3  
Old 12-11-2010, 09:23 AM
jbob182's Avatar
jbob182 jbob182 is offline
X-Fi2 Development Moderator
 
Join Date: Feb 2010
Location: The U.S.A.
Posts: 554
Default

I have had this problem for Plants vs Zombies, ballbounce, and some other apps that i have never posted due to the players limited capabilities.

If you wouldnt mind unencoding the code i can take a look at it and see where improvements for speed can be made, but i might not find much. This app looks like it had potential, have you had previouse proggraming experience?

I personally think encoding apps is not really worth it, they can be unedncoded easyly and can stop others from learning from the code, well that what i believe at least.


here is a quick screen shot of your code decompiled
Attached Images
File Type: png Snap1.png (77.3 KB, 72 views)

Last edited by jbob182; 12-11-2010 at 09:47 AM.
Reply With Quote

  #4  
Old 12-13-2010, 08:10 AM
Android18 Android18 is offline
Junior Member
 
Join Date: Dec 2010
Location: Pokhara,Nepal
Posts: 35
Default

Then i will attach the souce coade and thanks for the help

and yes its the first experience

I just encoded its so i could see if the luac works or not



Can u tell me if the framerate of zen is slower or its the processor thats making it so slow
Reply With Quote

  #5  
Old 12-13-2010, 08:12 AM
Habhome's Avatar
Habhome Habhome is offline
Moderator
 
Join Date: Jan 2010
Location: Sweden
Posts: 1,079
Default

Quote:
Originally Posted by Android18 View Post
Then i will attach the souce coade and thanks for the help

and yes its the first experience

I just encoded its so i could see if the luac works or not



Can u tell me if the framerate of zen is slower or its the processor thats making it so slow
It's the processor which is the culprit.
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine
Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it!
Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it.
Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^
Reply With Quote

  #6  
Old 12-26-2010, 05:26 AM
Android18 Android18 is offline
Junior Member
 
Join Date: Dec 2010
Location: Pokhara,Nepal
Posts: 35
Default

Hey it worrks fast and the simple codes allso seem to be lagging

May be it reequires a greater frameskip of 60.
Reply With Quote

  #7  
Old 12-26-2010, 05:32 AM
Android18 Android18 is offline
Junior Member
 
Join Date: Dec 2010
Location: Pokhara,Nepal
Posts: 35
Exclamation Can anyone help me code this game????

It still works so slow


What do u think can make it run faster???
Attached Files
File Type: zip Rocket v1.12.3.zip (10.0 KB, 6 views)
Reply With Quote

  #8  
Old 12-26-2010, 08:33 AM
jbob182's Avatar
jbob182 jbob182 is offline
X-Fi2 Development Moderator
 
Join Date: Feb 2010
Location: The U.S.A.
Posts: 554
Default

Ill take a look at it ans see what i can find
Reply With Quote

  #9  
Old 12-26-2010, 03:22 PM
Habhome's Avatar
Habhome Habhome is offline
Moderator
 
Join Date: Jan 2010
Location: Sweden
Posts: 1,079
Default

[Thread merged into existing one, please refrain from creating a new one about the same subject... Especially if you're the one starting the first thread...]
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine
Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it!
Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it.
Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^
Reply With Quote

  #10  
Old 12-31-2010, 05:02 AM
Android18 Android18 is offline
Junior Member
 
Join Date: Dec 2010
Location: Pokhara,Nepal
Posts: 35
Default Try my APP and help make it better

Try this and help it make more smooth it is so slow
how can i remove the glitches
Attached Files
File Type: zip Rocket v3.613.zip (10.0 KB, 12 views)
Reply With Quote

  #11  
Old 12-31-2010, 09:28 AM
jbob182's Avatar
jbob182 jbob182 is offline
X-Fi2 Development Moderator
 
Join Date: Feb 2010
Location: The U.S.A.
Posts: 554
Default

Please restrain from creating multiple threads about the same thing.
Reply With Quote

  #12  
Old 12-31-2010, 07:32 PM
Habhome's Avatar
Habhome Habhome is offline
Moderator
 
Join Date: Jan 2010
Location: Sweden
Posts: 1,079
Default

[Threads merged... ONCE again]
Please, don't create duplicate threads... Especially of your own!
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine
Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it!
Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it.
Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^
Reply With Quote

  #13  
Old 01-03-2011, 03:21 AM
Android18 Android18 is offline
Junior Member
 
Join Date: Dec 2010
Location: Pokhara,Nepal
Posts: 35
Default

No the app is different and try it there are a lot of changes in it

And i didnt really knew that earlier
i am sorry
Reply With Quote

  #14  
Old 01-03-2011, 10:54 AM
Habhome's Avatar
Habhome Habhome is offline
Moderator
 
Join Date: Jan 2010
Location: Sweden
Posts: 1,079
Default

Quote:
Originally Posted by Android18 View Post
No the app is different and try it there are a lot of changes in it

And i didnt really knew that earlier
i am sorry
Just because the app has been updated you cannot create a new thread, it IS still the same application. Or have you made an app with a completely new concept with the same name? I highly doubt that.
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine
Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it!
Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it.
Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^
Reply With Quote

  #15  
Old 01-03-2011, 03:34 PM
Brett_val's Avatar
Brett_val Brett_val is offline
Senior Member
 
Join Date: Jan 2010
Location: The Netherlands
Posts: 636
Default

It really looks fantastic, it's a shame the Zen can't keep up. But what's really not needed and takes a lot of time is the redrawing of the entire screen on line 420. Remove that and only redraw the parts that need to change (where the meteors and jet are). This way you also don't have to redraw all the stars every frame.

Also, the jet and the meteors consist of a LOT of lines, it would be faster if it were simpler figures (just a screen.drawrect perhaps) or perhaps an image, that would also make the rotating code of the jet a lot simpler.

Another thing I noticed is the collision checks, I think you are checking the distance from every line in the meteors against the bullets/jet positions. It might be quicker to consider the meteors as squares or circles and check if the jet or bullets intersect with those, because then it's just one check for every meteor.
Code:
--For squares:
function intersects(aX, aY, aW, aH,    bX, bY, bW, bH)
        return (aX < bX + bW) and (bX < aX + aW) and (aY < bY + bH) and (bY < aY + aH)
end
--For circles:
function incirc(x_ToCheck,y_ToCheck, x_object,y_object, radius)
    if x_ToCheck < x_object + ( math.sin( math.acos((y_ToCheck-y_object)/radius) ) * radius ) and x_ToCheck > x_object - ( math.sin( math.acos((y_ToCheck-y_object)/radius) ) * radius ) then
     return true
    end
end
But first remove the screen.fillrect on line 420 and be careful with what you re-draw, I think that's the biggest culprit.
__________________
this is a link to my personal homepage which I haven't
Reply With Quote

  #16  
Old 01-08-2011, 04:17 AM
Android18 Android18 is offline
Junior Member
 
Join Date: Dec 2010
Location: Pokhara,Nepal
Posts: 35
Default

But how can we rotate picture???
Ani i have taken the distance from the midpoint of the meteor !!!!!!!

Thanks for the advice
Reply With Quote

  #17  
Old 01-08-2011, 09:20 AM
jbob182's Avatar
jbob182 jbob182 is offline
X-Fi2 Development Moderator
 
Join Date: Feb 2010
Location: The U.S.A.
Posts: 554
Default

you cant rotate pictures on the zen..........(sigh).
i noticed you always have little stars on the screen, try removing them. redrawing the backround can be a big problem, but not as big as the stars in certain senarios.

Also are you removing and shots that go off the screen? or metors that are destoryed? doing these will stop your app from slowing down over time.

So pretty much: remove the stars or stop redrawing the backround and you will see an improvent in speed

I know for a fact the zen ( with little power it has) could support you app, only if you make cutbacks. In the case that there is still a slow down, remove the thrust animation, and replace it with a glow or something,dont redraw the backround, and also try to trade memory for speed.

This can be done ( trading space for speed) by memoizing

http://en.wikipedia.org/wiki/Memoization

looking through your code, i am not seeing one table.remove()

here is a code from bret_val's doodle jump for handling deleting parts of a table

Code:
bullets = {}   -- these go in your declaring section
toremove={}

for s=1, #bullets do -- goes in a repeating function
    if bullets[s].y > 400 then -- or whatever you want to use to check if a bullet is off the screen
          table.insert(toremove,s)
      end
end

while true do
    table.sort(toremove) -- removes the objects that have left the screen to speed up the game
    for t=#toremove,1,-1 do  --(from Bret_val(doodlejump))
            table.remove(bullets,toremove[t])
    end
    toremove={}
end

Last edited by jbob182; 01-08-2011 at 01:05 PM.
Reply With Quote

  #18  
Old 01-08-2011, 12:13 PM
Brett_val's Avatar
Brett_val Brett_val is offline
Senior Member
 
Join Date: Jan 2010
Location: The Netherlands
Posts: 636
Default

No you can't rotate a picture, to use a picture as Jet you should have pictures of it in different positions, and change them out when rotating. I think that might be faster than calculating the angles and drawing all the lines.

But first remove the screen.fillrect(0,0,400,240) and only redraw the parts that have changed.
Maybe the stars have to go as well, it would be complicated to check if those need to be re-drawn.
__________________
this is a link to my personal homepage which I haven't
Reply With Quote

  #19  
Old 01-15-2011, 03:13 AM
Android18 Android18 is offline
Junior Member
 
Join Date: Dec 2010
Location: Pokhara,Nepal
Posts: 35
Default

yaaa so i have drawn them in every frame
And i have done that screen.fillrect(0,0,400,240) as well
and it really has become lot smoother
bUt the highscores,blur has gone
i have to remake it once
Thanks for the advice
Reply With Quote

  #20  
Old 01-15-2011, 03:29 AM
Android18 Android18 is offline
Junior Member
 
Join Date: Dec 2010
Location: Pokhara,Nepal
Posts: 35
Default

dO U KNOW HOW TO GET EVERY PIXELS OF A BITMAP PICTURE???
then we could save it in an array and rotate it.... May be even slower but tat works...
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 04:19 PM.