Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Thread Tools Display Modes
Prev Previous Post   Next Post Next
Question with memory
Junior Member
Status: Offline
Posts: 2
Join Date: Jun 2017
Location: MA
Default Question with memory - 06-14-2017, 07:41 PM

Hello everyone!

I'm working on a game for school and have noticed that I am starting to get some lag, and fear I'm using way too much memory.

My game has a player that constantly moves forward. Along the path they encounter obstacles in the form of various animations. For example, there are dogs pacing back and forth, cars moving, people walking, etc.

As of now I have the various obstacle's individual animation methods in a do together block

do together
Each of these individual methods then looks like this:

While world.playing==true
test if player is within 15 meters car1
then car1 move forward at speed

In an attempt to make every play unique, all of the animations are currently using a select-random-number-between to determine the distance away from the player to begin moving and the object's speed itself.

I'm thinking that this is likely not the proper or most efficient way to tackle this and I'm afraid of making my code any messier than it probable already is. Any suggestions on a better way to handle this? Will removing the random number selections make a difference?

Also on a different but similar note, is there a decent strategy for collision detection using arrays instead of lists? For instance I have a lot of stationary items that need collision detection as well. I have broken them down into organized lists and am using the for all items together code.

Hopefully this makes some sense

Last edited by thatCarpenterGuy; 06-14-2017 at 07:43 PM.
Reply With Quote

Thread Tools
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

Copyright ©2019, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.