Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.sys.apple2.programmer > #447
| Newsgroups | comp.sys.apple2.programmer |
|---|---|
| Date | 2012-09-03 10:02 -0700 |
| References | (3 earlier) <94327602-28af-4fcf-81ae-62f5ceb836c3@googlegroups.com> <46024113-85e4-4981-9977-7416d940c3b9@googlegroups.com> <e05bcfbe-d0a2-4e55-9409-61493adce218@googlegroups.com> <64bf7b23-417e-4640-b6c8-a5e48c46e238@googlegroups.com> <84f4cb4a-98ba-452b-afea-8fece2827a5b@googlegroups.com> |
| Message-ID | <417b083b-e8ff-44a5-be82-6f3f6c4a899a@googlegroups.com> (permalink) |
| Subject | Re: ideas for super mario bros? |
| From | aiiadict@gmail.com |
On Sunday, September 2, 2012 1:10:41 PM UTC-7, Antoine Vignau wrote:
> Great, what you have written is the second way to handle sprites, through lists and, as you have pointed, may save time compared to browsing a finite buffer in which you will have only 1/10 filled in with sprites.
Ok, this is what I figured. Having a buffer with animation steps could be good for a screen which has many animations. Mario has few. I don't want to do background animations at this point, I don't think there are enough cycles. So flashing question mark bricks won't flash... Coins won't spin.
>
>
>
> There are two ways to handle it:
>
> 1. when you add an enemy:
>
> 1.1 browse the list and find the first empty member of the list, add it there
>
> 1.2 append it to the existing list
>
>
>
> 2. when you kill an enemy (object, whatever)
>
> 2.1 set a special value (let's say -1) to the list member to set it available
>
> 2.2 change pointers (tell member-1 that next member is member+1 and not member)
>
> 2.3 shift member list (member << member+1 << member+2)
>
I am compacting the list when an enemy/powerup terminates.
when KillEnemy, TouchPowerup:
CurrentEnemy = animation to be terminated
NumberOfEnemies= NumberOfEnemies -1
for I = CurrentEnemy to NumberOfEnemies
EnemyType(i)= EnemyType(I+1)
EnemyX(I) = EnemyX(I+1)
Enemyy(I) = Enemyy(I+1)
EnemyXchange(i) = EnemyXchange(i+1)
EnemyYchange(i) = EnemyYchange(i+1)
Next I
Then to add an enemy:
NumberOfEnemies =NumberOfEnemies + 1
EnemyType(NumberOfEnemies)= whatever
EnemyX(NumberOfEnemies) = whatever
Enemyy(NumberOfEnemies) = whatever
EnemyXchange(NumberOfEnemies) = whatever
EnemyYchange(NumberOfEnemies) = whatever
Back to comp.sys.apple2.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
ideas for super mario bros? aiiadict@gmail.com - 2012-08-16 22:20 -0700
Re: ideas for super mario bros? BLuRry <brendan.robert@gmail.com> - 2012-08-17 08:20 -0700
Re: ideas for super mario bros? aiiadict@gmail.com - 2012-08-20 14:07 -0700
Re: ideas for super mario bros? Antoine Vignau <antoine.vignau@laposte.net> - 2012-08-21 01:10 -0700
Re: ideas for super mario bros? BLuRry <brendan.robert@gmail.com> - 2012-08-21 09:44 -0700
Re: ideas for super mario bros? D Finnigan <dog_cow@macgui.com> - 2012-08-21 17:12 +0000
Re: ideas for super mario bros? aiiadict@gmail.com - 2012-08-21 22:48 -0700
Re: ideas for super mario bros? Egan Ford <datajerk@gmail.com> - 2012-08-22 08:34 -0600
Re: ideas for super mario bros? aiiadict@gmail.com - 2012-08-22 09:49 -0700
Re: ideas for super mario bros? aiiadict@gmail.com - 2012-08-23 16:59 -0700
Re: ideas for super mario bros? aiiadict@gmail.com - 2012-08-28 20:24 -0700
Re: ideas for super mario bros? aiiadict@gmail.com - 2012-08-29 07:55 -0700
Re: ideas for super mario bros? Antoine Vignau <antoine.vignau@laposte.net> - 2012-08-29 10:35 -0700
Re: ideas for super mario bros? aiiadict@gmail.com - 2012-08-29 13:03 -0700
Re: ideas for super mario bros? BLuRry <brendan.robert@gmail.com> - 2012-08-29 16:07 -0700
Re: ideas for super mario bros? aiiadict@gmail.com - 2012-08-29 18:04 -0700
Re: ideas for super mario bros? aiiadict@gmail.com - 2012-09-08 09:03 -0700
Re: ideas for super mario bros? Antoine Vignau <antoine.vignau@laposte.net> - 2012-09-09 14:21 -0700
Re: ideas for super mario bros? aiiadict@gmail.com - 2012-08-30 09:15 -0700
Re: ideas for super mario bros? Antoine Vignau <antoine.vignau@laposte.net> - 2012-09-02 13:10 -0700
Re: ideas for super mario bros? BLuRry <brendan.robert@gmail.com> - 2012-09-02 14:30 -0700
Re: ideas for super mario bros? aiiadict@gmail.com - 2012-09-03 17:02 -0700
Re: ideas for super mario bros? aiiadict@gmail.com - 2012-09-03 10:02 -0700
Re: ideas for super mario bros? Antoine Vignau <antoine.vignau@laposte.net> - 2012-09-03 14:30 -0700
Re: ideas for super mario bros? aiiadict@gmail.com - 2012-09-05 15:50 -0700
Re: ideas for super mario bros? aiiadict@gmail.com - 2012-08-29 07:59 -0700
csiph-web