Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 [tutorial] Smooth Animation / Moving Background
Index -> Programming, Turing -> Turing Tutorials
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
AsianSensation




PostPosted: Wed Mar 17, 2004 2:26 pm   Post subject: (No subject)

currently, no. There isnt anyway for you to make it faster.

However, there are methods you can use to reduce the intensity of this problem. Regulate the amount of frames per seconds in your program will make it run at a smooth pace. So it won't be really fast in the beginning and crawling at the end.

Pic.Free the pictures that you are not using, so if the enemy flew off the screen, or died, Pic.Free it, and don't draw it anymore. This will free up the memory, so you don't have to deal with so many pictures.

Another thing, limit the amount of stuff on screen. A space game with like 30 something objects on the screen at the same time isn't that bad, and it will run very smooth. Unless you have huge pictures and gigantic amount of pictures on the screen at a time, like 100+, then there shouldn't be a problem.
Sponsor
Sponsor
Sponsor
sponsor
hq78




PostPosted: Mon Jan 10, 2005 4:18 pm   Post subject: (No subject)

how do you make the background picture bigger... like a lot bigger!
Cervantes




PostPosted: Mon Jan 10, 2005 8:42 pm   Post subject: (No subject)

Pic.Scale might be of use to you.
Forumer




PostPosted: Wed Dec 03, 2008 8:04 am   Post subject: (No subject)

ShadowStorm @ Fri Apr 25, 2003 9:43 am wrote:
i'm quite new to Turing and i need a little help on this... the screen keeps on flickering and i can't get a clean/smooth animation

code:

setscreen ( "graphics:1000;700")
var x,y : int
var sky : int
var ship : int
var backgroundPictureWidth, backgroundPictureHeight : int
var backgroundPictureX, backgroundPictureY : int

ship := Pic.FileNew ("c5.bmp")
sky := Pic.FileNew ("sky.jpg")
backgroundPictureWidth := Pic.Width (sky)
backgroundPictureHeight := Pic.Height (sky)
backgroundPictureX := (backgroundPictureWidth - (maxx + 1)) div 2
backgroundPictureY := (backgroundPictureHeight - (maxy + 1)) div 2



x:=100
y:=100
var chars : array char of boolean
        loop
       
        Input.KeyDown (chars)
            if chars (KEY_UP_ARROW) then
                y:=y+15
            end if
            if chars (KEY_RIGHT_ARROW) then
                x:=x+15
            end if
            if chars (KEY_LEFT_ARROW) then
                x:=x-15
            end if
            if chars (KEY_DOWN_ARROW) then
                y:=y-15
            end if
            cls
            Pic.Draw (sky, -backgroundPictureX, -backgroundPictureY, picCopy)
            Pic.Draw(ship,x,y,picMerge)
            View.Update
        end loop


thanx..


code:

setscreen ( "offscreenonly,graphics:1000;700")
var x,y : int
var sky : int
var ship : int
var backgroundPictureWidth, backgroundPictureHeight : int
var backgroundPictureX, backgroundPictureY : int

ship := Pic.FileNew ("c5.bmp")
sky := Pic.FileNew ("sky.jpg")
backgroundPictureWidth := Pic.Width (sky)
backgroundPictureHeight := Pic.Height (sky)
backgroundPictureX := (backgroundPictureWidth - (maxx + 1)) div 2
backgroundPictureY := (backgroundPictureHeight - (maxy + 1)) div 2



x:=100
y:=100
var chars : array char of boolean
        loop
       
        Input.KeyDown (chars)
            if chars (KEY_UP_ARROW) then
                y:=y+15
            end if
            if chars (KEY_RIGHT_ARROW) then
                x:=x+15
            end if
            if chars (KEY_LEFT_ARROW) then
                x:=x-15
            end if
            if chars (KEY_DOWN_ARROW) then
                y:=y-15
            end if
            cls
            Pic.Draw (sky, -backgroundPictureX, -backgroundPictureY, picCopy)
            Pic.Draw(ship,x,y,picMerge)
            View.Update
        end loop


fixed it for ya
Parker




PostPosted: Wed Dec 03, 2008 8:35 am   Post subject: RE:[tutorial] Smooth Animation / Moving Background

Forumer, please check the date of the post. Yes, you may have fixed that but I doubt he was still trying to figure it out 3 years later Razz

The date of each post is located right above the text.
rcbhs




PostPosted: Wed Dec 03, 2008 3:42 pm   Post subject: Re: [tutorial] Smooth Animation / Moving Background

Umm, a solution i can think of is that you may not be freeing memory where you can. IE. Your done with a sprite and it won't be used again, then sprite.free it.
Parker




PostPosted: Thu Dec 04, 2008 8:40 am   Post subject: RE:[tutorial] Smooth Animation / Moving Background

rcbhs, just like I posted just before you, the code you are referring to was done like 3 years ago, and they aren't still trying to figure it out to this day (I hope). Please check the date of when it was posted before you post.

The date of each post is located above the text.
Flipmc




PostPosted: Wed Jan 07, 2009 6:07 pm   Post subject: RE:[tutorial] Smooth Animation / Moving Background

Awesome man, thanks alot for this.
Sponsor
Sponsor
Sponsor
sponsor
livingheaven




PostPosted: Sat May 29, 2010 8:51 pm   Post subject: RE:[tutorial] Smooth Animation / Moving Background

NICE.
Insectoid




PostPosted: Sat May 29, 2010 9:04 pm   Post subject: RE:[tutorial] Smooth Animation / Moving Background

Was that single word really worth re-resurrecting an eight-year-old thread with over a year since the last post?
Unnamed.t




PostPosted: Sat May 29, 2010 9:20 pm   Post subject: Re: [tutorial] Smooth Animation / Moving Background

@livingheaven

I know I'm not any kind of Compsci admin but, please don't bring up threads that are over a year old for no apparent reason (LIKE JUST SAYING NICE). It isn't recommended to bring these posts up at all, except if there is a proper reason to do so, for example: you just found out a way to make Turing animations even smoother or faster.

What you did is called Necro posting and you will probably get banned soon if you continue to do this. I recommend that you review the compsci rules.
supaphreek




PostPosted: Sun May 30, 2010 10:28 am   Post subject: (No subject)

HeTeRiC @ Sat Nov 22, 2003 4:17 pm wrote:
Wow that was fast!
Thank You Burn
"one more thing!"
how do you stop it from moving past the point then still be able to move the object.
(move star around box but non let if exit box?)
i just need to know how to stop if from moving while still being able to controll it in other directions
thnaks again


What you could do is find whatever variable is loading the x and y position of jupiter. Then using that, you can have an if statement like

if x > 500 then
x := 500
end if


This will say that if the x point of the image is above 500, it will make it to 500 Razz
Insectoid




PostPosted: Sun May 30, 2010 10:55 am   Post subject: RE:[tutorial] Smooth Animation / Moving Background

Supaphreek, will you please check the date of the post you're quoting? That person either ditched CS years ago or has acquired a degree by now. It's even worse that you posted this DIRECTLY AFTER someone else was reprimanded for necroing this very thread.
Tony




PostPosted: Sun May 30, 2010 11:18 am   Post subject: RE:[tutorial] Smooth Animation / Moving Background

You guys are ridiculous. Locked.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Tutorials
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 2  [ 29 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: