PSPверсия |  Новое на сайте |  Обратная связь |  Команда сайта |  FAQ |  ПРАВИЛА |     
 
Обзор нового на PSPinfo.RU

Ближайшие Сходки:
ДатаГородНомерНазваниеЗаписаться
собери друзей и сообщи об этом всем! »»
Самые популярные FLASH игры:

Sonic
играли 89408 раз

Muay Thai
играли 44478 раз

Castle Defender
играли 42472 раз

Urabanslug
играли 36338 раз

Mud and Blood (vietnam)
играли 34379 раз

chicken
играли 33775 раз

sonicblox
играли 33654 раз

x227sm
играли 33570 раз

Crazy Scates
играли 28396 раз
Абсолютные лидеры:
НовостиТемыСейвыОбоиВидеороликиВикторина
1..:Dr.Who:.945
2.iliya23420
3.Константин414
4.(:389
5.Masserau377
1.Dankin333
2.Игорь330
3.kalash1322
4.DJAMrik271
5.Артем=)252
1..:Dr.Who:.347
2.legofan12130
3.-=Sephiroth=-117
4.Dan96106
5.Patric Star104
1.wushu12250
2.Metal Sonic7404
3.iliya237000
4.Теккен6652
5.LFY6309
1..:Dr.Who:.4548
2.Михаил3742
3..:Canon:.1920
4.Ivan1760
5.Гомер Симпсон1535
1.Chizuru Minamoto2610552500
2..:Dr.Who:.2609446950
3..:Buxou:.1724432140
4.snupi1637432090
5.vitas1551113420750
расширенная статистика »»

   Все форумы » Клуб PSPinfo.RU » Программирование » Multiple Bullets Предыдущая тема :: Следующая тема  
Сейчас эту тему просматривают: [требуется регистрация] -> [требуется регистрация]
Гостей: [требуется регистрация]
 
Ссылка на пост #1 Добавлено: 29 июня 2011 14:29    

Забанен
Pre-IPL
--

Возраст: -- | |
Сообщений: 184
Благодарности: 12 / 2
Репутация: 6
Предупреждений: 2
Друзья
Тут: 12 лет 9 месяцев
Всем добрый день.
Хочу показать вам скрипт на Multiple Bullets.



green=Color.new(0,255,0)
white = Color.new(255,255,255)
blue=Color.new(0,0,255)
bullet = Image.createEmpty(4,4)
bullet:clear(green)


player = Image.createEmpty(32,32)
player:clear(white)


oldpad = Controls.read()
currentBullet = 0
direction = "right"

Player = {}
Player[1] = { x = 30, y = 100 }


BulletInfo = {}
for a = 1,5 do
BulletInfo[a] = { pic = bullet , firing = false, direction = "right", x = Player[1].x + 32,
y = Player[1].y + 16 }
end


function bulletSetup()

if currentBullet < 5 then
currentBullet = currentBullet + 1
else
currentBullet = 1
end

if direction == "left" then
BulletInfo[currentBullet].x = Player[1].x
BulletInfo[currentBullet].y = Player[1].y + 16
end
if direction == "right" then
BulletInfo[currentBullet].x = Player[1].x + 32
BulletInfo[currentBullet].y = Player[1].y + 16
end
if direction == "up" then
BulletInfo[currentBullet].x = Player[1].x + 16
BulletInfo[currentBullet].y = Player[1].y
end
if direction == "down" then
BulletInfo[currentBullet].x = Player[1].x + 16
BulletInfo[currentBullet].y = Player[1].y + 32
end

BulletInfo[currentBullet].direction = direction
BulletInfo[currentBullet].firing = true
end

function bulletFire()
for i = 1,5 do
if BulletInfo[i].firing == true then
if BulletInfo[i].direction == "right" then BulletInfo[i].x = BulletInfo[i].x + 10 end
if BulletInfo[i].direction == "left" then BulletInfo[i].x = BulletInfo[i].x - 10 end
if BulletInfo[i].direction == "up" then BulletInfo[i].y = BulletInfo[i].y - 10 end
if BulletInfo[i].direction == "down" then BulletInfo[i].y = BulletInfo[i].y + 10 end
screen:blit(BulletInfo[i].x,BulletInfo[i].y,BulletInfo[i].pic)
end
if BulletInfo[i].x 480 or BulletInfo[i].y 272 then
BulletInfo[i].firing = false
end
end
end

function movePlayer()
pad = Controls.read()
if pad:left() then
Player[1].x = Player[1].x - 1
direction = "left"
end
if pad:right() then
Player[1].x = Player[1].x + 1
direction = "right"
end
if pad:up() then
Player[1].y = Player[1].y - 1
direction = "up"
end
if pad:down() then
Player[1].y = Player[1].y + 1
direction = "down"
end
end


while true do
pad = Controls.read()
screen:clear(blue)

screen:blit(Player[1].x, Player[1].y, player)

if pad:cross() and oldpad:cross() ~= pad:cross() then
bulletSetup()
end

movePlayer()

bulletFire()

screen.waitVblankStart()
screen.flip()
oldpad = pad
end


Добавлено спустя 23 минуты 3 секунды:

Просмотр.

Сообщение отредактировано 29 июня 2011 14:19. Редактировалось 2 раз(а)
Наверх 
Multiple Bullets
  • 0

  
Добавить эту тему в

Похожие темы:
Название Темы [ответов]АвторДатаФорум
Похожих тем не найдено.

Информация
Посетители, находящиеся в группе Гости, не могут оставлять сообщения в данной теме.


Flash игры onLine |  Игры для PSP |  Обои для PSP |  Софт для PSP |  Темы для PSP |  Сейвы для PSP |  Комиксы для PSP |  Форум |  Карта сайта |   
"" and "PlayStation" are registered trademarks of Sony Computer Entertainment Inc. "", PSP and "UMD" are trademarks of Sony Computer Entertainment Inc. "", "XMB", "Memory Stick Duo" and the "Memory Stick Duo" logotype are trademarks of Sony Corp. All product titles, publisher names, trademarks, artwork and associated imagery are trademarks, registered trademarks and/or copyright material of the respective owners. All rights reserved.
Game's TOP-100 Counter