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


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

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

Возраст: -- | |
Сообщений: 184
Благодарности: 12 / 2
Репутация: 6
Предупреждений: 2
Друзья
Тут: 14 лет
Всем добрый день.
Хочу показать вам скрипт на 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 Рейтинг@Mail.ru
Дешевле не найти
gameADnet - выгодная реклама для сайтов с играми