Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.apple2.programmer > #447

Re: ideas for super mario bros?

Received by 10.68.213.68 with SMTP id nq4mr3241169pbc.6.1346691732723; Mon, 03 Sep 2012 10:02:12 -0700 (PDT)
Received by 10.68.189.228 with SMTP id gl4mr2877721pbc.4.1346691732653; Mon, 03 Sep 2012 10:02:12 -0700 (PDT)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!newsfeed.news.ucla.edu!usenet.stanford.edu!r4no5249357pbs.0!news-out.google.com!t10ni19137469pbh.0!nntp.google.com!4no5125032pbn.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.sys.apple2.programmer
Date Mon, 3 Sep 2012 10:02:12 -0700 (PDT)
In-Reply-To <84f4cb4a-98ba-452b-afea-8fece2827a5b@googlegroups.com>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=108.230.94.47; posting-account=5kmk9wkAAAB22-WWGK8UTn8vQ5c3EvdQ
NNTP-Posting-Host 108.230.94.47
References <f20ea197-84e6-41cd-8ca6-baa04edacabb@googlegroups.com> <aa9d119a-f65e-401c-aa20-b7acba951219@googlegroups.com> <8a0a7a48-e956-4f4b-ad95-e2677a68767b@googlegroups.com> <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>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <417b083b-e8ff-44a5-be82-6f3f6c4a899a@googlegroups.com> (permalink)
Subject Re: ideas for super mario bros?
From aiiadict@gmail.com
Injection-Date Mon, 03 Sep 2012 17:02:12 +0000
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
Xref csiph.com comp.sys.apple2.programmer:447

Show key headers only | View raw


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 | NextPrevious in thread | Next in thread | Find similar


Thread

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