Scrolling image background is taking up too much processing?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
CoffeeCone
Posts: 64
Joined: Fri Apr 26, 2013 8:38 am

Scrolling image background is taking up too much processing?

Post by CoffeeCone » Sat Apr 27, 2013 1:35 pm

I am trying to make a simple scrolling game but the resource usage is so heavy. What am I doing wrong here?
Attachments
traveltime.livecode.zip
(241.95 KiB) Downloaded 184 times
Learning LiveCode, one step at a time.

dave_probertGA6e24
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 328
Joined: Mon Dec 05, 2011 5:34 pm
Contact:

Re: Scrolling image background is taking up too much process

Post by dave_probertGA6e24 » Sat Apr 27, 2013 4:48 pm

A couple of bits:

Scrolling by 1 pixel is a VERY slow movement (1 pixel every 50 milliseconds = 32 seconds to scroll 640 pixels!!)

Also you need to learn "left" from "right" :) regarding the side you set.

Anyway - here is a modified version with a couple of ideas in the buttons...

Enjoy.

Dave
Attachments
traveltime_davemod.livecode.zip
(242.28 KiB) Downloaded 233 times
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Scrolling image background is taking up too much process

Post by jmburnod » Sat Apr 27, 2013 5:06 pm

Hi,
Sorry for the short post. I have to move.

Code: Select all

on closecard
stopPending startScrolling
end closecard


on stopPending pPending
   repeat for each line aLine in the pendingmessages
      if aLine contains pPending then
         cancel item 1 of aLine
      end if
   end repeat
end stopPending
Best regards
Jean-Marc
https://alternatic.ch

Post Reply