WoSGamers

WoSGamers welcome you again, the view faces, pleasing your body - thanking!

Scratch has many limitations, but I thought I could find my way around one of the major ones ...

After some success with the Arkanoid demo I created in Scratch with only one brick sprite being stamped in multiple places, I thought I'd go for a parallax scrolling starfield using only one sprite object for next week's practical session.

I started off by creating a Star sprite with two costumes, one with a single white pixel for drawing the star, and one with a single black pixel for erasing the star, and the stage set to black. I then added in some movement code so it would repeatedly scroll down the screen and wrap when it got to the bottom ... worked ok.

I changed it so I had two stars (one sprite), each with x, y, and speed variables so that they would do the same ... move down the screen and wrap, but stamping the sprite in the appropriate places ... still seemed fine. At this point it looked possible, but I would need to create 3 more variables for each star and the code was gonna get messy, so I decided to use lists.

With three lists, I could keep track of x and y positions as well as the speed the star would move at, by adding values to the lists at the start and then replacing these values. Once I had the code matching the 6 variable version, I executed it and saw a major slow down :(. I thought that was it, lists are too slow and was about to give up when I realised that displaying all 6 variables and 3 changing lists on the stage is bound to slow things down a bit ... removed them from the screen and things went back to a reasonable speed.

Great! Or so I thought ...

I then add in a numStars and loop variable so I could set the number of stars at the top, and execute everything inside a loop, setting the loop variable to 1 at the start and incrementing it inside the repeat loop so I had an index into the lists. If this worked then I would have a parallax scrolling starfield demo that would work with however many stars you wanted ... but Scratch had other ideas. Although my code does in fact work, Scratch is just not for letting me away with that amount of processing, and just slows to a crawl.

Ah well, back to the drawing board. Guess I'll be giving a different practical exercise on Monday then :(

Scratch project is here if anyone wants a look at it

Tags: limitations, parallax, scratch, scrolling, starfield

Share 

Add a Comment

You need to be a member of WoSGamers to add comments!

Join this social network

About

John Sutherland John Sutherland created this social network on Ning.

Music

Loading…

Poll


Santa's coming, lock up your daughters!
What do you want the fat old man with the fake beard to bring you for Christmas? (you can choose as many as you want!)
Final Fantasy XIII
Nintendo DS LL
Super Street Fighter IV
Sony PSP Go Black
MAG: Massive Action
Xbox 360 with Free60 preloaded
God of War III
Super Mario Bros. Wii
Nintendo Wii Black
Battlefield: Bad Company 2
Pandora Open Source console
Rogue Warrior
Sony PS3 Slim 250Gb
Bayonetta
Apple iPod touch
Resident Evil: Darkside
to pass Computer Systems
Gran Turismo 5


Forum

Steven Logan

Do we need to come into uni this week at all?

Started by Steven Logan in Teaching & Learning @UWS 29 minutes ago.

Kalakian

Intro to Games Dev - Games 22 Replies

Started by Kalakian in Teaching & Learning @UWS. Last reply by Daniel Livingstone 4 hours ago.

Thee Forsaken One

Decent Screen Recorders 6 Replies

Started by Thee Forsaken One in Tech Chat. Last reply by Jonathan Traynor 16 hours ago.

Tam

Rage Against X Factor 3 Replies

Started by Tam in News. Last reply by Gary Hogg 17 hours ago.

Euan "YONS" Hislop

Christmas and new year lab times 1 Reply

Started by Euan "YONS" Hislop in Teaching & Learning @UWS. Last reply by Stevo aka Dr Katata Fish 1 day ago.

Jon Robertson

Final Fantasy XIII 10 Replies

Started by Jon Robertson in Just for fun. Last reply by Kazzie 1 day ago.

Kazzie

Final Fantasy FXIV beta testing applications 5 Replies

Started by Kazzie in Just for fun. Last reply by Kazzie Dec 18.

Phil McCauley

GameSpot's Best of 2009!

Started by Phil McCauley in Just for fun Dec 18.

Daniel Livingstone

PhD opportunities

Started by Daniel Livingstone in Portfolios & Employment Dec 16.

Michael "Bez" Berryman

Stupid Answers 3 Replies

Started by Michael "Bez" Berryman in Just for fun. Last reply by Prof. Dr. SatNAV MSc CGT DDR FF7 Dec 16.

Kieran Nelson

Realtime Worlds Student Programming Contest 5 Replies

Started by Kieran Nelson in Teaching & Learning @UWS. Last reply by Ross Forshaw Dec 16.

Jeremy Koester

Looking for programming support 2 Replies

Started by Jeremy Koester in Portfolios & Employment. Last reply by Jeremy Koester Dec 16.

Daniel Livingstone

CGD Project: Design and Plan

Started by Daniel Livingstone in Teaching & Learning @UWS Dec 15.

Stevo aka Dr Katata Fish

John Sutherland 69 Replies

Started by Stevo aka Dr Katata Fish in News. Last reply by Stevo aka Dr Katata Fish Dec 15.

Stevo aka Dr Katata Fish

SAAS 6 Replies

Started by Stevo aka Dr Katata Fish in News. Last reply by Jon Robertson Dec 11.

David McClure

Multimedia Fusion 2 Discounts 1 Reply

Started by David McClure in News. Last reply by Kieran Nelson Dec 9.

Tam

Evony Web advert evolution 5 Replies

Started by Tam in Just for fun. Last reply by John Sutherland Dec 9.

Peter Bloomfield

My new favourite puzzle game

Started by Peter Bloomfield in Just for fun Dec 8.

John Sutherland

Dare to Be Digital 32 Replies

Started by John Sutherland in Projects. Last reply by John Sutherland Dec 8.

Badge

Loading…

© 2009   Created by John Sutherland on Ning.   Create Your Own Social Network

Badges  |  Report an Issue  |  Privacy  |  Terms of Service

Sign in to chat!